From 5f44c67e06986080c81c8bd415d6301044f0f254 Mon Sep 17 00:00:00 2001 From: jagpreetsinghsasan Date: Thu, 25 Jul 2024 09:43:33 +0530 Subject: [PATCH] build(api-client): generate go client Primary Changes ---------------- 1. Updated package.json file for packages to include the new codegen script 2. Added a new dep, replace for string manupulation in package.json Fixes #393 Signed-off-by: jagpreetsinghsasan --- .dcilintignore | 1 + .../package.json | 3 +- .../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 | 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 +++ .../package.json | 3 +- .../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 | 119 + .../openapi/go-client/api/openapi.yaml | 232 ++ .../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 +++ openapi-generator-ignore | 5 + package.json | 1 + packages/cactus-cmd-api-server/package.json | 3 +- .../go-client/.openapi-generator/FILES | 13 + .../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 +++ packages/cactus-core-api/package.json | 3 +- .../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 | 710 +++++ .../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 | 119 + .../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 +++ .../cactus-plugin-bungee-hermes/package.json | 2 +- .../package.json | 3 +- .../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 | 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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 25 + .../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 +++ .../cactus-plugin-htlc-eth-besu/package.json | 3 +- .../go-client/.openapi-generator/FILES | 25 + .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 18 + .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 18 + .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 18 + .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 18 + .../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 +++ .../package.json | 1 + .../go-client/.openapi-generator/FILES | 18 + .../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 +++ .../cactus-plugin-keychain-vault/package.json | 3 +- .../go-client/.openapi-generator/FILES | 18 + .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 32 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 137 + .../openapi/go-client/api/openapi.yaml | 651 +++++ .../openapi/go-client/api_default.go | 590 +++++ .../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_accept_invitation_v1_request.go | 146 ++ .../model_accept_invitation_v1_response.go | 118 + .../model_agent_connection_record_v1.go | 494 ++++ .../model_agent_connections_filter_v1.go | 342 +++ .../go-client/model_aries_agent_config_v1.go | 364 +++ .../go-client/model_aries_agent_summary_v1.go | 257 ++ ...el_aries_agent_summary_v1_wallet_config.go | 146 ++ .../model_aries_indy_vdr_pool_config_v1.go | 211 ++ .../model_aries_proof_exchange_record_v1.go | 337 +++ .../go-client/model_cacti_accept_policy_v1.go | 113 + .../model_cacti_proof_request_attribute_v1.go | 194 ++ ...te_new_connection_invitation_v1_request.go | 155 ++ ...e_new_connection_invitation_v1_response.go | 146 ++ .../model_error_exception_v1_response.go | 146 ++ .../model_get_connections_v1_request.go | 153 ++ .../model_request_proof_v1_request.go | 173 ++ ...model_watch_connection_state_options_v1.go | 118 + ...odel_watch_connection_state_progress_v1.go | 146 ++ .../model_watch_connection_state_v1.go | 117 + .../model_watch_proof_state_options_v1.go | 118 + .../model_watch_proof_state_progress_v1.go | 146 ++ .../go-client/model_watch_proof_state_v1.go | 117 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 85 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 53 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 165 ++ .../openapi/go-client/api/openapi.yaml | 1333 ++++++++++ .../openapi/go-client/api_default.go | 1272 +++++++++ .../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 ++ ...olidity_bytecode_no_keychain_v1_request.go | 414 +++ ...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 + .../model_watch_blocks_v1_request.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 +++ .../package.json | 3 +- .../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 | 130 + .../openapi/go-client/api/openapi.yaml | 498 ++++ .../openapi/go-client/api_default.go | 483 ++++ .../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 + .../model_auth_info_access_token_v1.go | 144 ++ .../model_auth_info_subscription_key_v1.go | 225 ++ .../openapi/go-client/model_auth_info_v1.go | 148 ++ .../go-client/model_cdl_common_response_v1.go | 154 ++ .../model_error_exception_response_v1.go | 146 ++ .../go-client/model_event_lineage_v1.go | 279 ++ .../model_gateway_configuration_v1.go | 270 ++ .../model_get_lineage_option_direction_v1.go | 113 + .../go-client/model_get_lineage_request_v1.go | 220 ++ .../model_get_lineage_response_v1.go | 144 ++ .../model_register_history_data_request_v1.go | 263 ++ ...model_register_history_data_v1_response.go | 144 ++ .../model_search_lineage_request_v1.go | 175 ++ .../model_search_lineage_response_v1.go | 144 ++ .../go-client/model_search_lineage_type_v1.go | 113 + .../go-client/model_trail_event_details_v1.go | 216 ++ .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 73 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../package.json | 3 +- .../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 | 157 ++ .../openapi/go-client/api/openapi.yaml | 1418 ++++++++++ .../openapi/go-client/api_default.go | 1188 +++++++++ .../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 | 217 ++ .../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 ++ .../go-client/model_vault_query_v1_request.go | 127 + .../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 +++ .../package.json | 3 +- .../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 | 152 ++ .../openapi/go-client/api/openapi.yaml | 1013 ++++++++ .../openapi/go-client/api_default.go | 695 +++++ .../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 | 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 | 205 ++ .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 71 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 179 ++ .../openapi/go-client/api/openapi.yaml | 2090 +++++++++++++++ .../openapi/go-client/api_default.go | 930 +++++++ .../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_cacti_block_full_event_v1.go | 225 ++ .../model_cacti_block_full_response_v1.go | 117 + .../model_cacti_block_transaction_event_v1.go | 202 ++ ...el_cacti_block_transactions_response_v1.go | 118 + .../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_certificate_identity_v1.go | 144 ++ .../model_fabric_contract_invocation_type.go | 113 + .../model_fabric_signing_credential.go | 252 ++ .../model_fabric_signing_credential_type.go | 113 + .../model_fabric_x509_certificate_v1.go | 279 ++ .../openapi/go-client/model_file_base64.go | 183 ++ .../model_full_block_transaction_action_v1.go | 225 ++ ...l_full_block_transaction_endorsement_v1.go | 144 ++ .../model_full_block_transaction_event_v1.go | 279 ++ .../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 | 249 ++ .../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 + .../model_get_block_response_type_v1.go | 115 + .../go-client/model_get_block_response_v1.go | 208 ++ .../model_get_chain_info_request_v1.go | 182 ++ .../model_get_chain_info_response_v1.go | 174 ++ .../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 | 117 + .../model_watch_blocks_options_v1.go | 209 ++ .../model_watch_blocks_private_response_v1.go | 122 + .../model_watch_blocks_response_v1.go | 268 ++ .../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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 39 + .../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 +++ .../package.json | 6 +- .../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 | 147 ++ .../openapi/go-client/api/openapi.yaml | 700 +++++ .../openapi/go-client/api_default.go | 820 ++++++ .../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_deploy_contract_ink_request.go | 400 +++ ...del_deploy_contract_ink_request_balance.go | 148 ++ ...l_deploy_contract_ink_request_gas_limit.go | 144 ++ .../model_deploy_contract_ink_request_salt.go | 123 + ...tract_ink_request_storage_deposit_limit.go | 153 ++ .../model_deploy_contract_ink_response.go | 153 ++ .../model_error_exception_response.go | 146 ++ .../model_invoke_contract_request.go | 399 +++ .../model_invoke_contract_response.go | 226 ++ ...model_polkadot_contract_invocation_type.go | 111 + .../model_polkadot_transaction_config.go | 225 ++ ...transaction_config_transfer_submittable.go | 118 + ...model_polkadot_transaction_config_value.go | 118 + .../model_raw_transaction_request.go | 144 ++ .../model_raw_transaction_response.go | 117 + .../model_raw_transaction_response_data.go | 117 + ...transaction_response_response_container.go | 200 ++ .../model_run_transaction_request.go | 144 ++ .../model_run_transaction_response.go | 189 ++ .../model_sign_raw_transaction_request.go | 180 ++ .../model_sign_raw_transaction_response.go | 144 ++ .../model_transaction_info_request.go | 146 ++ .../model_transaction_info_response.go | 117 + .../model_transaction_info_response_data.go | 175 ++ ...action_info_response_response_container.go | 200 ++ .../model_web3_signing_credential.go | 178 ++ ..._signing_credential_cactus_keychain_ref.go | 173 ++ ...web3_signing_credential_mnemonic_string.go | 145 ++ .../model_web3_signing_credential_none.go | 117 + .../model_web3_signing_credential_type.go | 113 + .../generated/openapi/go-client/response.go | 47 + .../go-client/test/api_default_test.go | 109 + .../go/generated/openapi/go-client/utils.go | 347 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 27 + .../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 | 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_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 +++ .../package.json | 3 +- .../go-client/.openapi-generator/FILES | 37 + .../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 +++ .../package.json | 6 +- .../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 | 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 +++ .../package.json | 8 +- .../go-client/.openapi-generator/FILES | 13 + .../go-client/.openapi-generator/VERSION | 1 + .../generated/openapi/go-client/.travis.yml | 8 + .../go/generated/openapi/go-client/README.md | 114 + .../openapi/go-client/api/openapi.yaml | 113 + .../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_status_response_v1.go | 257 ++ .../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 +++ .../cactus-plugin-satp-hermes/package.json | 3 +- .../go-client/.openapi-generator/FILES | 37 + .../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 +++ .../openapi/go-client/model_local_log.go | 279 ++ .../model_lock_evidence_v1_request.go | 451 ++++ .../model_lock_evidence_v1_response.go | 325 +++ .../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_satp_message.go | 522 ++++ .../model_satp_message_action_response.go | 162 ++ .../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 +++ yarn.lock | 48 +- 853 files changed, 168295 insertions(+), 41 deletions(-) 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-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 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-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-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-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/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-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-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-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-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/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-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-ledger-connector-aries/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connection_record_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connections_filter_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_config_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1_wallet_config.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_indy_vdr_pool_config_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_proof_exchange_record_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_accept_policy_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_proof_request_attribute_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_error_exception_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_get_connections_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_request_proof_v1_request.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_options_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_progress_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_options_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_progress_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/utils.go 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_no_keychain_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_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_watch_blocks_v1_request.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-cdl/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_access_token_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_subscription_key_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_cdl_common_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_event_lineage_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_gateway_configuration_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_option_direction_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_v1_response.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_type_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_trail_event_details_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/utils.go 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_vault_query_v1_request.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-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-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_cacti_block_full_event_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_full_response_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_transaction_event_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_transactions_response_v1.go 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_certificate_identity_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_fabric_x509_certificate_v1.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_full_block_transaction_action_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_endorsement_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_event_v1.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_type_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_chain_info_request_v1.go create mode 100644 packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_chain_info_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-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-polkadot/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_balance.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_gas_limit.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_salt.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_storage_deposit_limit.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_error_exception_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_request.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_contract_invocation_type.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_transfer_submittable.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_value.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_data.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_response_container.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_request.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_request.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_data.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_response_container.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_mnemonic_string.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/utils.go 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-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-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-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/api_default.go 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/model_error_exception_response_v1.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_status_response_v1.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go 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/test/api_default_test.go create mode 100644 packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.travis.yml create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/README.md create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/api_default.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/client.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/configuration.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/go.mod create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/go.sum create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_history.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_local_log.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message_action_response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_session_data.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/response.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go create mode 100644 packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/utils.go diff --git a/.dcilintignore b/.dcilintignore index cfd767c057c..1c3fed1ff1a 100644 --- a/.dcilintignore +++ b/.dcilintignore @@ -15,6 +15,7 @@ packages/cactus-test-tooling/src/main/typescript/keycloak/keycloak-container.ts # Generated code that cannot be modified examples/cactus-example-carbon-accounting-backend/src/main/json/generated/build-info/** +**/src/main/go/generated/openapi/go-client/client.go # Cannot be edited as its a name of a imported Corda library, and Corda syntax weaver/core/drivers/corda-driver/src/main/kotlin/CustomSerializationWhitelist.kt diff --git a/extensions/cactus-plugin-htlc-coordinator-besu/package.json b/extensions/cactus-plugin-htlc-coordinator-besu/package.json index 355b2d4191c..823a44dd381 100644 --- a/extensions/cactus-plugin-htlc-coordinator-besu/package.json +++ b/extensions/cactus-plugin-htlc-coordinator-besu/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "run-p generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev webpack:prod", 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..96d87952e3e --- /dev/null +++ b/extensions/cactus-plugin-htlc-coordinator-besu/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_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 +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..fed7a1366d5 --- /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: 2.0.0-rc.3 +- 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..0cce7f238af --- /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: 2.0.0-rc.3 +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 + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + 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 + 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 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..e75bd96af4e --- /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: 2.0.0-rc.3 +*/ + +// 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..479d02cf001 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..a96569a2e4b --- /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: 2.0.0-rc.3 +*/ + +// 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..eb1513fd108 --- /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: 2.0.0-rc.3 +*/ + +// 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..3e7e7fbe5a9 --- /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: 2.0.0-rc.3 +*/ + +// 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..afe6a7be5ec --- /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: 2.0.0-rc.3 +*/ + +// 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..d47c6f246e9 --- /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: 2.0.0-rc.3 +*/ + +// 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..b0f5b6eaaed --- /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: 2.0.0-rc.3 +*/ + +// 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..422d7a2b10a --- /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: 2.0.0-rc.3 +*/ + +// 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..f181ad5f4b8 --- /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: 2.0.0-rc.3 +*/ + +// 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..58a8f0e4532 --- /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: 2.0.0-rc.3 +*/ + +// 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..dc33d838b8b --- /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: 2.0.0-rc.3 +*/ + +// 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..cd262e50cb6 --- /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: 2.0.0-rc.3 +*/ + +// 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..b976796fac9 --- /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: 2.0.0-rc.3 +*/ + +// 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-object-store-ipfs/package.json b/extensions/cactus-plugin-object-store-ipfs/package.json index df73f5a7449..50224df4500 100644 --- a/extensions/cactus-plugin-object-store-ipfs/package.json +++ b/extensions/cactus-plugin-object-store-ipfs/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..1bca3406529 --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/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_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 +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..9b8e7ac5fd5 --- /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: 2.0.0-rc.3 +- 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..06204c0698c --- /dev/null +++ b/extensions/cactus-plugin-object-store-ipfs/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,232 @@ +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: 2.0.0-rc.3 +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: + additionalProperties: false + 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: + additionalProperties: false + 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: + additionalProperties: false + 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..624ef7c04be --- /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: 2.0.0-rc.3 +*/ + +// 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..485d391ea3d --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..b7ad8e3fabb --- /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: 2.0.0-rc.3 +*/ + +// 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..af47be5b660 --- /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: 2.0.0-rc.3 +*/ + +// 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..c2f0818f89c --- /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: 2.0.0-rc.3 +*/ + +// 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..172c332654e --- /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: 2.0.0-rc.3 +*/ + +// 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..6dac202b888 --- /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: 2.0.0-rc.3 +*/ + +// 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..d10d560b1c2 --- /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: 2.0.0-rc.3 +*/ + +// 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..9d371c38f47 --- /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: 2.0.0-rc.3 +*/ + +// 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..c24bbf3c62d --- /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: 2.0.0-rc.3 +*/ + +// 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..79cef3ce4b8 --- /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: 2.0.0-rc.3 +*/ + +// 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/openapi-generator-ignore b/openapi-generator-ignore index 9c765107220..e9bcfd10dc1 100644 --- a/openapi-generator-ignore +++ b/openapi-generator-ignore @@ -3,6 +3,7 @@ **/.gitignore **/generated/openapi/kotlin-client/docs/** **/generated/openapi/kotlin-client/gradle/** +<<<<<<< HEAD **/generated/**/.openapi-generator-ignore # TODO: Figure out a better way to generalize these ignore patterns that are @@ -11,3 +12,7 @@ packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin- packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/build.gradle.kts packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/Application.kt packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/test/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/api/ApiPluginLedgerConnectorCordaTest.kt +======= +**/generated/openapi/go-client/docs/** +**/generated/**/.openapi-generator-ignore +>>>>>>> 5f00f4fc1 (build(api-client): generate go client) diff --git a/package.json b/package.json index b7e615f938e..5d86658506a 100644 --- a/package.json +++ b/package.json @@ -192,6 +192,7 @@ "openapi-types": "12.1.3", "prettier": "3.2.5", "protoc-gen-ts": "0.8.7", + "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 1d2da7d2fee..472d654f382 100644 --- a/packages/cactus-cmd-api-server/package.json +++ b/packages/cactus-cmd-api-server/package.json @@ -45,10 +45,11 @@ "scripts": { "benchmark": "tsx ./src/test/typescript/benchmark/run-cmd-api-server-benchmark.ts .tmp/benchmark-results/cmd-api-server/run-cmd-api-server-benchmark.ts.log", "build:bundle": "ncc build ./dist/lib/main/typescript/cmd/cactus-api.js --minify --out=./dist/bundle/ncc/", - "codegen": "run-s 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "codegen:proto": "run-s proto:openapi proto:protoc-gen-ts", "generate-sdk": "run-s 'generate-sdk:*'", + "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: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", "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/", 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..8c0f008a05f --- /dev/null +++ b/packages/cactus-cmd-api-server/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,13 @@ +.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 +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..ba8f8c9d1e3 --- /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: 2.0.0-rc.3 +- 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..eb4edd3e058 --- /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: 2.0.0-rc.3 +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..9e56064eafb --- /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: 2.0.0-rc.3 +*/ + +// 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..0b8adb637e5 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..9d761b0c7bc --- /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: 2.0.0-rc.3 +*/ + +// 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..0047df26754 --- /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: 2.0.0-rc.3 +*/ + +// 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..43bb34ec132 --- /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: 2.0.0-rc.3 +*/ + +// 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..999a75690b7 --- /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: 2.0.0-rc.3 +*/ + +// 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..5801b2c88ac --- /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: 2.0.0-rc.3 +*/ + +// 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..cffaf79843d --- /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: 2.0.0-rc.3 +*/ + +// 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-core-api/package.json b/packages/cactus-core-api/package.json index 48ef01f8124..e318c103ac3 100644 --- a/packages/cactus-core-api/package.json +++ b/packages/cactus-core-api/package.json @@ -43,12 +43,13 @@ "dist/*" ], "scripts": { - "codegen": "run-s 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "codegen:proto": "run-s proto:protoc-gen-ts", "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", "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..67914022987 --- /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: 2.0.0-rc.3 +- 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..8c2fb201182 --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,710 @@ +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: 2.0.0-rc.3 +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_2 + - 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..cebef417b62 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..7203ae9005f --- /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: 2.0.0-rc.3 +*/ + +// 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..4b3eedd924d --- /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: 2.0.0-rc.3 +*/ + +// 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..b37a10a6304 --- /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: 2.0.0-rc.3 +*/ + +// 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..0366d6080dd --- /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: 2.0.0-rc.3 +*/ + +// 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..81603f6a412 --- /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: 2.0.0-rc.3 +*/ + +// 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..1cef9e31cc3 --- /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: 2.0.0-rc.3 +*/ + +// 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..fe5cf65ce30 --- /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: 2.0.0-rc.3 +*/ + +// 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..55bf2102c2d --- /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: 2.0.0-rc.3 +*/ + +// 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..09f61e4a78d --- /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: 2.0.0-rc.3 +*/ + +// 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..4d15f93c99b --- /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: 2.0.0-rc.3 +*/ + +// 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..be1475751b0 --- /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: 2.0.0-rc.3 +*/ + +// 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..f405c934965 --- /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: 2.0.0-rc.3 +*/ + +// 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..2b911a9a90a --- /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: 2.0.0-rc.3 +*/ + +// 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..5a2350373dd --- /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: 2.0.0-rc.3 +*/ + +// 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..1efd7a59cd2 --- /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: 2.0.0-rc.3 +*/ + +// 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..0e8eb0d8890 --- /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: 2.0.0-rc.3 +*/ + +// 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..31e67726463 --- /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: 2.0.0-rc.3 +*/ + +// 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..100e3157ccf --- /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: 2.0.0-rc.3 +*/ + +// 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..56ddc3ac1c3 --- /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: 2.0.0-rc.3 +*/ + +// 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..3ba7b958863 --- /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: 2.0.0-rc.3 +*/ + +// 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..a86ea90a6c0 --- /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: 2.0.0-rc.3 +*/ + +// 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..e412598a327 --- /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: 2.0.0-rc.3 +*/ + +// 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..02f799c1d40 --- /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: 2.0.0-rc.3 +*/ + +// 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..c337639b733 --- /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: 2.0.0-rc.3 +*/ + +// 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..9199b20438d --- /dev/null +++ b/packages/cactus-core-api/src/main/go/generated/openapi/go-client/model_ledger_type.go @@ -0,0 +1,119 @@ +/* +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: 2.0.0-rc.3 +*/ + +// 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_2 LedgerType = "FABRIC_2" + SAWTOOTH_1_X LedgerType = "SAWTOOTH_1X" +) + +// All allowed values of LedgerType enum +var AllowedLedgerTypeEnumValues = []LedgerType{ + "BESU_1X", + "BESU_2X", + "BURROW_0X", + "CORDA_4X", + "FABRIC_2", + "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..ac8d8a8c031 --- /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: 2.0.0-rc.3 +*/ + +// 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..2ce780c1525 --- /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: 2.0.0-rc.3 +*/ + +// 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..158f55f50cb --- /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: 2.0.0-rc.3 +*/ + +// 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..e15334dd69b --- /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: 2.0.0-rc.3 +*/ + +// 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..2b724d1a239 --- /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: 2.0.0-rc.3 +*/ + +// 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..d1ce1dc4aca --- /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: 2.0.0-rc.3 +*/ + +// 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..99d37dc9d67 --- /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: 2.0.0-rc.3 +*/ + +// 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..bb565ab7920 --- /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: 2.0.0-rc.3 +*/ + +// 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..533a56754dd --- /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: 2.0.0-rc.3 +*/ + +// 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..33763dfcf73 --- /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: 2.0.0-rc.3 +*/ + +// 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-plugin-bungee-hermes/package.json b/packages/cactus-plugin-bungee-hermes/package.json index a6624e66e68..986dbbc8a32 100644 --- a/packages/cactus-plugin-bungee-hermes/package.json +++ b/packages/cactus-plugin-bungee-hermes/package.json @@ -49,7 +49,7 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s '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", diff --git a/packages/cactus-plugin-consortium-manual/package.json b/packages/cactus-plugin-consortium-manual/package.json index b609dd682a2..70256ed616e 100644 --- a/packages/cactus-plugin-consortium-manual/package.json +++ b/packages/cactus-plugin-consortium-manual/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..184b7481ff5 --- /dev/null +++ b/packages/cactus-plugin-consortium-manual/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_get_consortium_jws_response.go +model_get_node_jws_response.go +model_jws_general.go +model_jws_recipient.go +response.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..ff3d20965bd --- /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: 2.0.0-rc.3 +- 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..2f5bad6c8cd --- /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: 2.0.0-rc.3 +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 + 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 + 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 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..6c6ff80cf21 --- /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: 2.0.0-rc.3 +*/ + +// 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..1d8cda356fa --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..45882d5c78c --- /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: 2.0.0-rc.3 +*/ + +// 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..9d05ff73517 --- /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: 2.0.0-rc.3 +*/ + +// 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..a6bcd647779 --- /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: 2.0.0-rc.3 +*/ + +// 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..927d098657c --- /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: 2.0.0-rc.3 +*/ + +// 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..ed7357e91e9 --- /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: 2.0.0-rc.3 +*/ + +// 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..53cc5764c60 --- /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: 2.0.0-rc.3 +*/ + +// 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..2529046a32f --- /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: 2.0.0-rc.3 +*/ + +// 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-htlc-eth-besu-erc20/package.json b/packages/cactus-plugin-htlc-eth-besu-erc20/package.json index 7644404d7d1..6d2c688435f 100644 --- a/packages/cactus-plugin-htlc-eth-besu-erc20/package.json +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/package.json @@ -48,9 +48,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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 --reserved-words-mappings type=type --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 --reserved-words-mappings type=type --ignore-file-override ../../openapi-generator-ignore", "watch": "npm-watch", 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..183474f28f4 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu-erc20/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,25 @@ +.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 +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..72987a67559 --- /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: 2.0.0-rc.3 +- 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..268faee6608 --- /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: 2.0.0-rc.3 +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 + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + 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 + 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 + 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 + 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 + 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..e2a51e4b475 --- /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: 2.0.0-rc.3 +*/ + +// 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..2a061ae8e74 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..5d29449ef57 --- /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: 2.0.0-rc.3 +*/ + +// 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..60226f87537 --- /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: 2.0.0-rc.3 +*/ + +// 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..ee753d9492f --- /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: 2.0.0-rc.3 +*/ + +// 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..a7916c4c1c7 --- /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: 2.0.0-rc.3 +*/ + +// 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..9e99ea91026 --- /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: 2.0.0-rc.3 +*/ + +// 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..24d5ab48e77 --- /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: 2.0.0-rc.3 +*/ + +// 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..089eca38b90 --- /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: 2.0.0-rc.3 +*/ + +// 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..01d274b77e1 --- /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: 2.0.0-rc.3 +*/ + +// 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..d9b27211a02 --- /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: 2.0.0-rc.3 +*/ + +// 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..11ef0b927af --- /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: 2.0.0-rc.3 +*/ + +// 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..003fe13646e --- /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: 2.0.0-rc.3 +*/ + +// 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..cca8abcba2c --- /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: 2.0.0-rc.3 +*/ + +// 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..f1b705fbe94 --- /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: 2.0.0-rc.3 +*/ + +// 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..23b753ed125 --- /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: 2.0.0-rc.3 +*/ + +// 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..b219940eed8 --- /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: 2.0.0-rc.3 +*/ + +// 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..3c9cf7c9166 --- /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: 2.0.0-rc.3 +*/ + +// 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..0575f457eb7 --- /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: 2.0.0-rc.3 +*/ + +// 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..a04e341b515 --- /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: 2.0.0-rc.3 +*/ + +// 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/package.json b/packages/cactus-plugin-htlc-eth-besu/package.json index 221894ee7e5..b023f506629 100644 --- a/packages/cactus-plugin-htlc-eth-besu/package.json +++ b/packages/cactus-plugin-htlc-eth-besu/package.json @@ -53,10 +53,11 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "compile-contracts": "forge build", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "lint": "solhint --fix", "watch": "npm-watch", 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..988f364d749 --- /dev/null +++ b/packages/cactus-plugin-htlc-eth-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,25 @@ +.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 +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..749313f79a6 --- /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: 2.0.0-rc.3 +- 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..9290d3b8951 --- /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: 2.0.0-rc.3 +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 + Web3SigningCredentialType: + enum: + - CACTUS_KEYCHAIN_REF + - GETH_KEYCHAIN_PASSWORD + - PRIVATE_KEY_HEX + - NONE + type: string + 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 + 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 + 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 + 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 + 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..81c1f44ad4c --- /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: 2.0.0-rc.3 +*/ + +// 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..54e6bb28a5a --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..bb351c0fb7c --- /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: 2.0.0-rc.3 +*/ + +// 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..700f2d19471 --- /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: 2.0.0-rc.3 +*/ + +// 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..b88e12d0f45 --- /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: 2.0.0-rc.3 +*/ + +// 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..74b16e83e3f --- /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: 2.0.0-rc.3 +*/ + +// 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..54f9d515399 --- /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: 2.0.0-rc.3 +*/ + +// 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..a35eb212c72 --- /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: 2.0.0-rc.3 +*/ + +// 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..e429564011a --- /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: 2.0.0-rc.3 +*/ + +// 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..db8bc6074f5 --- /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: 2.0.0-rc.3 +*/ + +// 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..9582eb86943 --- /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: 2.0.0-rc.3 +*/ + +// 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..1fa762806c6 --- /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: 2.0.0-rc.3 +*/ + +// 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..9f3d3f13aef --- /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: 2.0.0-rc.3 +*/ + +// 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..ab13349018c --- /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: 2.0.0-rc.3 +*/ + +// 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..1f0f1426f89 --- /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: 2.0.0-rc.3 +*/ + +// 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..da8d7268c5f --- /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: 2.0.0-rc.3 +*/ + +// 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..e6769e9e112 --- /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: 2.0.0-rc.3 +*/ + +// 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..a7e28697bd2 --- /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: 2.0.0-rc.3 +*/ + +// 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..7c76d2f7031 --- /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: 2.0.0-rc.3 +*/ + +// 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..bc3551ed093 --- /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: 2.0.0-rc.3 +*/ + +// 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-keychain-aws-sm/package.json b/packages/cactus-plugin-keychain-aws-sm/package.json index be21b14b4a1..6f50c2e476c 100644 --- a/packages/cactus-plugin-keychain-aws-sm/package.json +++ b/packages/cactus-plugin-keychain-aws-sm/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..28a644e272a --- /dev/null +++ b/packages/cactus-plugin-keychain-aws-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.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 +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..0b998e54505 --- /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: 2.0.0-rc.3 +- 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..50a33b91555 --- /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: 2.0.0-rc.3 +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..9827f22fca1 --- /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: 2.0.0-rc.3 +*/ + +// 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..fe7619a29cc --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..f40735f52ae --- /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: 2.0.0-rc.3 +*/ + +// 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..12502b5162d --- /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: 2.0.0-rc.3 +*/ + +// 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..9bacd54293b --- /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: 2.0.0-rc.3 +*/ + +// 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..f4c8db7f026 --- /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: 2.0.0-rc.3 +*/ + +// 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..13d8702e0f7 --- /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: 2.0.0-rc.3 +*/ + +// 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..d36f66733aa --- /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: 2.0.0-rc.3 +*/ + +// 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..a78a51084cd --- /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: 2.0.0-rc.3 +*/ + +// 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..c1988efd807 --- /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: 2.0.0-rc.3 +*/ + +// 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..ec1b4da7093 --- /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: 2.0.0-rc.3 +*/ + +// 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..13fc2a535ae --- /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: 2.0.0-rc.3 +*/ + +// 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..3d92361deef --- /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: 2.0.0-rc.3 +*/ + +// 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-azure-kv/package.json b/packages/cactus-plugin-keychain-azure-kv/package.json index 902431d6fbd..8abe0f2955b 100644 --- a/packages/cactus-plugin-keychain-azure-kv/package.json +++ b/packages/cactus-plugin-keychain-azure-kv/package.json @@ -48,9 +48,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..28a644e272a --- /dev/null +++ b/packages/cactus-plugin-keychain-azure-kv/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.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 +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..a43d7364bce --- /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: 2.0.0-rc.3 +- 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..6c94c18e656 --- /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: 2.0.0-rc.3 +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..568431c43ad --- /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: 2.0.0-rc.3 +*/ + +// 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..9001d377662 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..c3436ed884b --- /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: 2.0.0-rc.3 +*/ + +// 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..90e6a30b643 --- /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: 2.0.0-rc.3 +*/ + +// 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..fbe79c0ddb7 --- /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: 2.0.0-rc.3 +*/ + +// 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..77ef7ce31b9 --- /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: 2.0.0-rc.3 +*/ + +// 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..ce307bb5c93 --- /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: 2.0.0-rc.3 +*/ + +// 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..2dda7016128 --- /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: 2.0.0-rc.3 +*/ + +// 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..676216dd12f --- /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: 2.0.0-rc.3 +*/ + +// 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..97db513fc99 --- /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: 2.0.0-rc.3 +*/ + +// 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..6b09d089fe9 --- /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: 2.0.0-rc.3 +*/ + +// 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..4325f1a8624 --- /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: 2.0.0-rc.3 +*/ + +// 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..b68cc2e941d --- /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: 2.0.0-rc.3 +*/ + +// 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-google-sm/package.json b/packages/cactus-plugin-keychain-google-sm/package.json index f2f3b543467..5fd37285ed6 100644 --- a/packages/cactus-plugin-keychain-google-sm/package.json +++ b/packages/cactus-plugin-keychain-google-sm/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..28a644e272a --- /dev/null +++ b/packages/cactus-plugin-keychain-google-sm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.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 +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..a2600e7487d --- /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: 2.0.0-rc.3 +- 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..d000c2a6fa1 --- /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: 2.0.0-rc.3 +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..e8d5d4f1c7f --- /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: 2.0.0-rc.3 +*/ + +// 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..fea874321f8 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..7f6640b304f --- /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: 2.0.0-rc.3 +*/ + +// 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..890b84374e0 --- /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: 2.0.0-rc.3 +*/ + +// 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..3090ccff7e0 --- /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: 2.0.0-rc.3 +*/ + +// 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..74d4fc22584 --- /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: 2.0.0-rc.3 +*/ + +// 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..6be5c520ced --- /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: 2.0.0-rc.3 +*/ + +// 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..fe2de615d04 --- /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: 2.0.0-rc.3 +*/ + +// 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..d935702689f --- /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: 2.0.0-rc.3 +*/ + +// 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..c3a6f378eef --- /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: 2.0.0-rc.3 +*/ + +// 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..5f0877b3154 --- /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: 2.0.0-rc.3 +*/ + +// 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..130df070eb5 --- /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: 2.0.0-rc.3 +*/ + +// 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..fbb42a2266c --- /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: 2.0.0-rc.3 +*/ + +// 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-memory-wasm/package.json b/packages/cactus-plugin-keychain-memory-wasm/package.json index 9e86dd2d877..a3679e58a34 100644 --- a/packages/cactus-plugin-keychain-memory-wasm/package.json +++ b/packages/cactus-plugin-keychain-memory-wasm/package.json @@ -43,12 +43,13 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "copy-wasm-bg": "cpy './main/typescript/generated/wasm-pack/cactus_plugin_keychain_memory_wasm_bg*' '../dist/lib/' --cwd=src --parents", "del-wasm-pack-project-files": "del-cli src/main/typescript/generated/wasm-pack/{package.json,README.md,.gitignore}", "generate-rust-server": "openapi-generator-cli generate -i ./src/main/json/openapi.json -g rust-server -o ./src/main/rust/generated/openapi/rust-server", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "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/", 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..28a644e272a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory-wasm/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.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 +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..caa0b85c65a --- /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: 2.0.0-rc.3 +- 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..1d6c4df1926 --- /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: 2.0.0-rc.3 +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..8f61a1b7145 --- /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: 2.0.0-rc.3 +*/ + +// 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..1176b3a01bd --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..ff593c47c4d --- /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: 2.0.0-rc.3 +*/ + +// 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..8effb8713eb --- /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: 2.0.0-rc.3 +*/ + +// 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..52d65cf3629 --- /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: 2.0.0-rc.3 +*/ + +// 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..98f99e81fc7 --- /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: 2.0.0-rc.3 +*/ + +// 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..fc5a139227b --- /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: 2.0.0-rc.3 +*/ + +// 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..f9be5c98c30 --- /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: 2.0.0-rc.3 +*/ + +// 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..430b92cd1d2 --- /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: 2.0.0-rc.3 +*/ + +// 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..a6ecb6983f2 --- /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: 2.0.0-rc.3 +*/ + +// 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..d698b0b2e3f --- /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: 2.0.0-rc.3 +*/ + +// 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..f918b95311c --- /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: 2.0.0-rc.3 +*/ + +// 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..f076ee563c8 --- /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: 2.0.0-rc.3 +*/ + +// 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/package.json b/packages/cactus-plugin-keychain-memory/package.json index e410f1a9337..a95b20b2df1 100644 --- a/packages/cactus-plugin-keychain-memory/package.json +++ b/packages/cactus-plugin-keychain-memory/package.json @@ -47,6 +47,7 @@ "codegen:openapi": "npm run generate-sdk", "codegen:proto": "run-s proto:openapi proto:crpc", "generate-sdk": "run-s 'generate-sdk:*'", + "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: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", "proto:crpc": "yarn run --top-level buf generate --debug --verbose --template=./buf.gen.yaml --output ./src/main/typescript/generated/proto/crpc/ ./src/main/proto/generated/openapi/", 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..28a644e272a --- /dev/null +++ b/packages/cactus-plugin-keychain-memory/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.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 +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..7347baedc3b --- /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: 2.0.0-rc.3 +- 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..6f59918dad5 --- /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: 2.0.0-rc.3 +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..cf7aa00059e --- /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: 2.0.0-rc.3 +*/ + +// 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..ca79b41e48c --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..0780fa33a96 --- /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: 2.0.0-rc.3 +*/ + +// 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..bd4c54697a4 --- /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: 2.0.0-rc.3 +*/ + +// 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..a145cdf9d9e --- /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: 2.0.0-rc.3 +*/ + +// 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..f98b52b1e0c --- /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: 2.0.0-rc.3 +*/ + +// 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..a5e3723fe81 --- /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: 2.0.0-rc.3 +*/ + +// 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..e0109ff7ca3 --- /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: 2.0.0-rc.3 +*/ + +// 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..8cc6b6fc0b3 --- /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: 2.0.0-rc.3 +*/ + +// 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..16fa7d20b56 --- /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: 2.0.0-rc.3 +*/ + +// 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..b11a3d5c31d --- /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: 2.0.0-rc.3 +*/ + +// 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..f7a07460260 --- /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: 2.0.0-rc.3 +*/ + +// 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..ad5d9d0617d --- /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: 2.0.0-rc.3 +*/ + +// 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-vault/package.json b/packages/cactus-plugin-keychain-vault/package.json index d7940fb5750..45d27eac9ba 100644 --- a/packages/cactus-plugin-keychain-vault/package.json +++ b/packages/cactus-plugin-keychain-vault/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..28a644e272a --- /dev/null +++ b/packages/cactus-plugin-keychain-vault/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.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 +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..9575794a6bd --- /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: 2.0.0-rc.3 +- 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..c55166e34e9 --- /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: 2.0.0-rc.3 +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..f8dc821914e --- /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: 2.0.0-rc.3 +*/ + +// 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..144dd4956e7 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..7fd1182c11d --- /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: 2.0.0-rc.3 +*/ + +// 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..fe832d7f7c3 --- /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: 2.0.0-rc.3 +*/ + +// 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..1240c2f2427 --- /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: 2.0.0-rc.3 +*/ + +// 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..faccecc4c1a --- /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: 2.0.0-rc.3 +*/ + +// 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..36035326ddb --- /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: 2.0.0-rc.3 +*/ + +// 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..c2ac3b783a5 --- /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: 2.0.0-rc.3 +*/ + +// 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..5e9a636f87d --- /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: 2.0.0-rc.3 +*/ + +// 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..7d16b7f164f --- /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: 2.0.0-rc.3 +*/ + +// 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..084aa1bd702 --- /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: 2.0.0-rc.3 +*/ + +// 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..035d03b24ca --- /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: 2.0.0-rc.3 +*/ + +// 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..5000f16830a --- /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: 2.0.0-rc.3 +*/ + +// 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-ledger-connector-aries/package.json b/packages/cactus-plugin-ledger-connector-aries/package.json index a6bc879f94e..4b444826f94 100644 --- a/packages/cactus-plugin-ledger-connector-aries/package.json +++ b/packages/cactus-plugin-ledger-connector-aries/package.json @@ -44,9 +44,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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 --reserved-words-mappings protected=protected", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..c2951976b43 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,32 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_accept_invitation_v1_request.go +model_accept_invitation_v1_response.go +model_agent_connection_record_v1.go +model_agent_connections_filter_v1.go +model_aries_agent_config_v1.go +model_aries_agent_summary_v1.go +model_aries_agent_summary_v1_wallet_config.go +model_aries_indy_vdr_pool_config_v1.go +model_aries_proof_exchange_record_v1.go +model_cacti_accept_policy_v1.go +model_cacti_proof_request_attribute_v1.go +model_create_new_connection_invitation_v1_request.go +model_create_new_connection_invitation_v1_response.go +model_error_exception_v1_response.go +model_get_connections_v1_request.go +model_request_proof_v1_request.go +model_watch_connection_state_options_v1.go +model_watch_connection_state_progress_v1.go +model_watch_connection_state_v1.go +model_watch_proof_state_options_v1.go +model_watch_proof_state_progress_v1.go +model_watch_proof_state_v1.go +response.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-aries/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-aries/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-aries/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/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-aries/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..80295177cb4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,137 @@ +# Go API client for cactus-plugin-ledger-connector-aries + +Can communicate with other Aries agents and Cacti Aries connectors + +## 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: 2.0.0-rc.3 +- 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-aries "github.com/hyperledger/cactus-plugin-ledger-connector-aries/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-aries.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-aries.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-aries.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-aries.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* | [**AcceptInvitationV1**](docs/DefaultApi.md#acceptinvitationv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/accept-invitation | Connect to another agent using it's invitation URL +*DefaultApi* | [**CreateNewConnectionInvitationV1**](docs/DefaultApi.md#createnewconnectioninvitationv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/create-new-connection-invitation | Create new aries agent invitation that other agents can use to connect. +*DefaultApi* | [**GetAgentsV1**](docs/DefaultApi.md#getagentsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-agents | Get all Aries agents configured in this connector plugin. +*DefaultApi* | [**GetConnectionsV1**](docs/DefaultApi.md#getconnectionsv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-connections | Get all connections of given aries agent. +*DefaultApi* | [**RequestProofV1**](docs/DefaultApi.md#requestproofv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/request-proof | Request proof matching provided requriements from connected peer agent. + + +## Documentation For Models + + - [AcceptInvitationV1Request](docs/AcceptInvitationV1Request.md) + - [AcceptInvitationV1Response](docs/AcceptInvitationV1Response.md) + - [AgentConnectionRecordV1](docs/AgentConnectionRecordV1.md) + - [AgentConnectionsFilterV1](docs/AgentConnectionsFilterV1.md) + - [AriesAgentConfigV1](docs/AriesAgentConfigV1.md) + - [AriesAgentSummaryV1](docs/AriesAgentSummaryV1.md) + - [AriesAgentSummaryV1WalletConfig](docs/AriesAgentSummaryV1WalletConfig.md) + - [AriesIndyVdrPoolConfigV1](docs/AriesIndyVdrPoolConfigV1.md) + - [AriesProofExchangeRecordV1](docs/AriesProofExchangeRecordV1.md) + - [CactiAcceptPolicyV1](docs/CactiAcceptPolicyV1.md) + - [CactiProofRequestAttributeV1](docs/CactiProofRequestAttributeV1.md) + - [CreateNewConnectionInvitationV1Request](docs/CreateNewConnectionInvitationV1Request.md) + - [CreateNewConnectionInvitationV1Response](docs/CreateNewConnectionInvitationV1Response.md) + - [ErrorExceptionV1Response](docs/ErrorExceptionV1Response.md) + - [GetConnectionsV1Request](docs/GetConnectionsV1Request.md) + - [RequestProofV1Request](docs/RequestProofV1Request.md) + - [WatchConnectionStateOptionsV1](docs/WatchConnectionStateOptionsV1.md) + - [WatchConnectionStateProgressV1](docs/WatchConnectionStateProgressV1.md) + - [WatchConnectionStateV1](docs/WatchConnectionStateV1.md) + - [WatchProofStateOptionsV1](docs/WatchProofStateOptionsV1.md) + - [WatchProofStateProgressV1](docs/WatchProofStateProgressV1.md) + - [WatchProofStateV1](docs/WatchProofStateV1.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-aries/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..a3094ec764f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,651 @@ +openapi: 3.0.3 +info: + description: Can communicate with other Aries agents and Cacti Aries connectors + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cacti Plugin - Connector Aries + version: 2.0.0-rc.3 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-agents: + post: + operationId: getAgentsV1 + parameters: [] + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetAgentsV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionV1Response' + description: Internal Server Error + summary: Get all Aries agents configured in this connector plugin. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-agents + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-connections: + post: + operationId: getConnectionsV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetConnectionsV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetConnectionsV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionV1Response' + description: Internal Server Error + summary: Get all connections of given aries agent. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-connections + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/create-new-connection-invitation: + post: + operationId: createNewConnectionInvitationV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateNewConnectionInvitationV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateNewConnectionInvitationV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionV1Response' + description: Internal Server Error + summary: Create new aries agent invitation that other agents can use to connect. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/create-new-connection-invitation + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/accept-invitation: + post: + operationId: acceptInvitationV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptInvitationV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptInvitationV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionV1Response' + description: Internal Server Error + summary: Connect to another agent using it's invitation URL + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/accept-invitation + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/request-proof: + post: + operationId: requestProofV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RequestProofV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AriesProofExchangeRecordV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionV1Response' + description: Internal Server Error + summary: Request proof matching provided requriements from connected peer agent. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/request-proof +components: + schemas: + WatchConnectionStateV1: + description: Websocket requests for monitoring connection change events. + enum: + - org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Subscribe + - org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Next + - org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Unsubscribe + - org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Error + - org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchConnectionStateOptionsV1: + description: Options passed when monitoring connection change events. + properties: + agentName: + description: Aries agent label that will also be used as wallet id. + nullable: false + type: string + required: + - agentName + type: object + WatchConnectionStateProgressV1: + description: Values pushed on each connection state change. + properties: + connectionRecord: + $ref: '#/components/schemas/AgentConnectionRecordV1' + previousState: + nullable: true + type: string + required: + - connectionRecord + - previousState + type: object + WatchProofStateV1: + description: Websocket requests for monitoring proof state change events. + enum: + - org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Subscribe + - org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Next + - org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Unsubscribe + - org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Error + - org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Complete + type: string + x-enum-varnames: + - Subscribe + - Next + - Unsubscribe + - Error + - Complete + WatchProofStateOptionsV1: + description: Options passed when monitoring proof state change events. + properties: + agentName: + description: Aries agent label that will also be used as wallet id. + nullable: false + type: string + required: + - agentName + type: object + WatchProofStateProgressV1: + description: Values pushed on each proof state change. + properties: + proofRecord: + $ref: '#/components/schemas/AriesProofExchangeRecordV1' + previousState: + nullable: true + type: string + required: + - previousState + - proofRecord + type: object + CactiAcceptPolicyV1: + description: Credential / Proof requests acceptance policies for Aries agent + enum: + - always + - contentApproved + - never + type: string + x-enum-varnames: + - Always + - ContentApproved + - Never + CactiProofRequestAttributeV1: + description: Credential attribute checks to be performed by a proof request. + example: + name: name + isValueEqual: "" + isCredentialDefinitionIdEqual: "" + properties: + name: + description: Attribute name. + nullable: false + type: string + isValueEqual: + description: Check if attribute has specified value + nullable: false + isCredentialDefinitionIdEqual: + description: Check if credentialDefinitionId has specified value + nullable: false + required: + - name + type: object + AriesProofExchangeRecordV1: + additionalProperties: true + description: Proof exchange record from Aries framework (simplified) + example: + threadId: threadId + isVerified: true + errorMessage: errorMessage + connectionId: connectionId + protocolVersion: protocolVersion + id: id + state: state + properties: + id: + nullable: false + type: string + connectionId: + nullable: false + type: string + threadId: + nullable: false + type: string + state: + nullable: false + type: string + protocolVersion: + nullable: false + type: string + isVerified: + nullable: false + type: boolean + errorMessage: + nullable: false + type: string + required: + - id + - protocolVersion + - state + - threadId + type: object + AriesIndyVdrPoolConfigV1: + description: Indy VDR network configuration + properties: + genesisTransactions: + description: Indy genesis transactions. + nullable: false + type: string + isProduction: + description: Flag to specify whether this is production or development ledger. + nullable: false + type: boolean + indyNamespace: + description: Indy namespace + nullable: false + type: string + connectOnStartup: + description: Connect to the ledger on startup flag + nullable: false + type: boolean + required: + - genesisTransactions + - indyNamespace + - isProduction + type: object + AriesAgentConfigV1: + description: Aries agent configuration to be setup and used by the connector. + properties: + name: + description: Aries agent label that will also be used as wallet id. + nullable: false + type: string + walletKey: + description: Wallet private key - do not share with anyone. + nullable: false + type: string + walletPath: + description: "Path to wallet sqlite database to use. If not provided, the\ + \ connector default path and agent name will be used." + nullable: false + type: string + indyNetworks: + items: + $ref: '#/components/schemas/AriesIndyVdrPoolConfigV1' + nullable: false + type: array + inboundUrl: + default: undefined + description: Inbound endpoint URL for this agent. Must be unique for this + connector. Must contain port. + example: http://127.0.0.1:1234 + nullable: false + type: string + autoAcceptConnections: + default: false + description: Flag to accept new connection by default + nullable: false + type: boolean + autoAcceptCredentials: + $ref: '#/components/schemas/CactiAcceptPolicyV1' + autoAcceptProofs: + $ref: '#/components/schemas/CactiAcceptPolicyV1' + required: + - indyNetworks + - name + - walletKey + type: object + AriesAgentSummaryV1: + description: Summary of an Aries Agent configured in the connector. + example: + isAgentInitialized: true + isWalletInitialized: true + endpoints: + - endpoints + - endpoints + isWalletProvisioned: true + name: name + walletConfig: + id: id + type: type + properties: + name: + description: Aries label of an agent + nullable: false + type: string + isAgentInitialized: + description: True when Aries agent has been initialized properly. + nullable: false + type: boolean + isWalletInitialized: + description: True when this agents wallet has been initialized properly. + nullable: false + type: boolean + isWalletProvisioned: + description: True when this agents wallet has been provisioned properly. + nullable: false + type: boolean + walletConfig: + $ref: '#/components/schemas/AriesAgentSummaryV1_walletConfig' + endpoints: + description: Aries agent endpoints configured + items: + nullable: false + type: string + nullable: false + type: array + required: + - endpoints + - isAgentInitialized + - isWalletInitialized + - isWalletProvisioned + - name + - walletConfig + type: object + AgentConnectionsFilterV1: + description: Fields that can be used to filter agent connection list. + example: + threadId: threadId + role: role + theirDid: theirDid + invitationDid: invitationDid + outOfBandId: outOfBandId + state: state + did: did + properties: + did: + nullable: false + type: string + invitationDid: + nullable: false + type: string + outOfBandId: + nullable: false + type: string + role: + nullable: false + type: string + state: + nullable: false + type: string + theirDid: + nullable: false + type: string + threadId: + nullable: false + type: string + type: object + AgentConnectionRecordV1: + additionalProperties: true + description: Aries agent connection information. + example: + threadId: threadId + role: role + theirDid: theirDid + theirLabel: theirLabel + isReady: true + errorMessage: errorMessage + alias: alias + invitationDid: invitationDid + outOfBandId: outOfBandId + state: state + did: did + properties: + state: + nullable: false + type: string + role: + nullable: false + type: string + isReady: + nullable: false + type: boolean + did: + nullable: false + type: string + theirDid: + nullable: false + type: string + theirLabel: + nullable: false + type: string + alias: + nullable: false + type: string + threadId: + nullable: false + type: string + errorMessage: + nullable: false + type: string + outOfBandId: + nullable: false + type: string + invitationDid: + nullable: false + type: string + required: + - isReady + - role + - state + type: object + GetConnectionsV1Request: + description: Request for GetConnections endpoint. + example: + filter: + threadId: threadId + role: role + theirDid: theirDid + invitationDid: invitationDid + outOfBandId: outOfBandId + state: state + did: did + agentName: agentName + properties: + agentName: + nullable: false + type: string + filter: + $ref: '#/components/schemas/AgentConnectionsFilterV1' + required: + - agentName + type: object + GetConnectionsV1Response: + default: [] + description: Response for GetConnections endpoint. + items: + $ref: '#/components/schemas/AgentConnectionRecordV1' + type: array + GetAgentsV1Response: + default: [] + description: Response for GetAgents endpoint. + items: + $ref: '#/components/schemas/AriesAgentSummaryV1' + type: array + CreateNewConnectionInvitationV1Request: + description: Request for CreateNewConnectionInvitation endpoint. + example: + invitationDomain: invitationDomain + agentName: agentName + properties: + agentName: + description: Aries label of an agent to use to generate an invitation + nullable: false + type: string + invitationDomain: + description: "Invitation URL domain to use. If not specified, then connector\ + \ default domain will be used" + nullable: false + type: string + required: + - agentName + type: object + CreateNewConnectionInvitationV1Response: + description: Response for CreateNewConnectionInvitation endpoint. + example: + invitationUrl: invitationUrl + outOfBandId: outOfBandId + properties: + invitationUrl: + description: Invitation URL that can be used by another aries agent to connect + to us. + nullable: false + type: string + outOfBandId: + description: ID that can be used to track status of the connection + nullable: false + type: string + required: + - invitationUrl + - outOfBandId + type: object + AcceptInvitationV1Request: + description: Request for AcceptInvitation endpoint. + example: + invitationUrl: invitationUrl + agentName: agentName + properties: + agentName: + description: Aries label of an agent to be used to connect using URL + nullable: false + type: string + invitationUrl: + description: Invitation URL generated by another aries agent. + nullable: false + type: string + required: + - agentName + - invitationUrl + type: object + AcceptInvitationV1Response: + description: Response for AcceptInvitation endpoint. + example: + outOfBandId: outOfBandId + properties: + outOfBandId: + description: ID that can be used to track status of the connection + nullable: false + type: string + required: + - outOfBandId + type: object + RequestProofV1Request: + description: Request for RequestProof endpoint. + example: + agentName: agentName + connectionId: connectionId + proofAttributes: + - name: name + isValueEqual: "" + isCredentialDefinitionIdEqual: "" + - name: name + isValueEqual: "" + isCredentialDefinitionIdEqual: "" + properties: + agentName: + description: Aries label of an agent to be used to connect using URL + nullable: false + type: string + connectionId: + description: Peer connection ID from which we want to request a proof. + nullable: false + type: string + proofAttributes: + items: + $ref: '#/components/schemas/CactiProofRequestAttributeV1' + nullable: false + type: array + required: + - agentName + - connectionId + - proofAttributes + type: object + ErrorExceptionV1Response: + 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 + AriesAgentSummaryV1_walletConfig: + example: + id: id + type: type + nullable: false + properties: + id: + description: Wallet entry ID + nullable: false + type: string + type: + description: Wallet storage type + nullable: false + type: string + required: + - id + - type + type: object diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..97da1653242 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,590 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiAcceptInvitationV1Request struct { + ctx context.Context + ApiService *DefaultApiService + acceptInvitationV1Request *AcceptInvitationV1Request +} + +func (r ApiAcceptInvitationV1Request) AcceptInvitationV1Request(acceptInvitationV1Request AcceptInvitationV1Request) ApiAcceptInvitationV1Request { + r.acceptInvitationV1Request = &acceptInvitationV1Request + return r +} + +func (r ApiAcceptInvitationV1Request) Execute() (*AcceptInvitationV1Response, *http.Response, error) { + return r.ApiService.AcceptInvitationV1Execute(r) +} + +/* +AcceptInvitationV1 Connect to another agent using it's invitation URL + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAcceptInvitationV1Request +*/ +func (a *DefaultApiService) AcceptInvitationV1(ctx context.Context) ApiAcceptInvitationV1Request { + return ApiAcceptInvitationV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AcceptInvitationV1Response +func (a *DefaultApiService) AcceptInvitationV1Execute(r ApiAcceptInvitationV1Request) (*AcceptInvitationV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AcceptInvitationV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AcceptInvitationV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/accept-invitation" + + 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.acceptInvitationV1Request + 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 ErrorExceptionV1Response + 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 ApiCreateNewConnectionInvitationV1Request struct { + ctx context.Context + ApiService *DefaultApiService + createNewConnectionInvitationV1Request *CreateNewConnectionInvitationV1Request +} + +func (r ApiCreateNewConnectionInvitationV1Request) CreateNewConnectionInvitationV1Request(createNewConnectionInvitationV1Request CreateNewConnectionInvitationV1Request) ApiCreateNewConnectionInvitationV1Request { + r.createNewConnectionInvitationV1Request = &createNewConnectionInvitationV1Request + return r +} + +func (r ApiCreateNewConnectionInvitationV1Request) Execute() (*CreateNewConnectionInvitationV1Response, *http.Response, error) { + return r.ApiService.CreateNewConnectionInvitationV1Execute(r) +} + +/* +CreateNewConnectionInvitationV1 Create new aries agent invitation that other agents can use to connect. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateNewConnectionInvitationV1Request +*/ +func (a *DefaultApiService) CreateNewConnectionInvitationV1(ctx context.Context) ApiCreateNewConnectionInvitationV1Request { + return ApiCreateNewConnectionInvitationV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CreateNewConnectionInvitationV1Response +func (a *DefaultApiService) CreateNewConnectionInvitationV1Execute(r ApiCreateNewConnectionInvitationV1Request) (*CreateNewConnectionInvitationV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateNewConnectionInvitationV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateNewConnectionInvitationV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/create-new-connection-invitation" + + 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.createNewConnectionInvitationV1Request + 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 ErrorExceptionV1Response + 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 ApiGetAgentsV1Request struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetAgentsV1Request) Execute() ([]AriesAgentSummaryV1, *http.Response, error) { + return r.ApiService.GetAgentsV1Execute(r) +} + +/* +GetAgentsV1 Get all Aries agents configured in this connector plugin. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetAgentsV1Request +*/ +func (a *DefaultApiService) GetAgentsV1(ctx context.Context) ApiGetAgentsV1Request { + return ApiGetAgentsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AriesAgentSummaryV1 +func (a *DefaultApiService) GetAgentsV1Execute(r ApiGetAgentsV1Request) ([]AriesAgentSummaryV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AriesAgentSummaryV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAgentsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-agents" + + 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, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionV1Response + 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 ApiGetConnectionsV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getConnectionsV1Request *GetConnectionsV1Request +} + +func (r ApiGetConnectionsV1Request) GetConnectionsV1Request(getConnectionsV1Request GetConnectionsV1Request) ApiGetConnectionsV1Request { + r.getConnectionsV1Request = &getConnectionsV1Request + return r +} + +func (r ApiGetConnectionsV1Request) Execute() ([]AgentConnectionRecordV1, *http.Response, error) { + return r.ApiService.GetConnectionsV1Execute(r) +} + +/* +GetConnectionsV1 Get all connections of given aries agent. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConnectionsV1Request +*/ +func (a *DefaultApiService) GetConnectionsV1(ctx context.Context) ApiGetConnectionsV1Request { + return ApiGetConnectionsV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return []AgentConnectionRecordV1 +func (a *DefaultApiService) GetConnectionsV1Execute(r ApiGetConnectionsV1Request) ([]AgentConnectionRecordV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []AgentConnectionRecordV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetConnectionsV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/get-connections" + + 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.getConnectionsV1Request + 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 ErrorExceptionV1Response + 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 ApiRequestProofV1Request struct { + ctx context.Context + ApiService *DefaultApiService + requestProofV1Request *RequestProofV1Request +} + +func (r ApiRequestProofV1Request) RequestProofV1Request(requestProofV1Request RequestProofV1Request) ApiRequestProofV1Request { + r.requestProofV1Request = &requestProofV1Request + return r +} + +func (r ApiRequestProofV1Request) Execute() (*AriesProofExchangeRecordV1, *http.Response, error) { + return r.ApiService.RequestProofV1Execute(r) +} + +/* +RequestProofV1 Request proof matching provided requriements from connected peer agent. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRequestProofV1Request +*/ +func (a *DefaultApiService) RequestProofV1(ctx context.Context) ApiRequestProofV1Request { + return ApiRequestProofV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return AriesProofExchangeRecordV1 +func (a *DefaultApiService) RequestProofV1Execute(r ApiRequestProofV1Request) (*AriesProofExchangeRecordV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AriesProofExchangeRecordV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RequestProofV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-aries/request-proof" + + 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.requestProofV1Request + 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 ErrorExceptionV1Response + 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-aries/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..3152b389788 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +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 Cacti Plugin - Connector Aries API v2.0.0-rc.3 +// 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-aries/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..07d38f0679e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +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-aries/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..83df8fee325 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/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-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_request.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_request.go new file mode 100644 index 00000000000..cb2325918b2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AcceptInvitationV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AcceptInvitationV1Request{} + +// AcceptInvitationV1Request Request for AcceptInvitation endpoint. +type AcceptInvitationV1Request struct { + // Aries label of an agent to be used to connect using URL + AgentName string `json:"agentName"` + // Invitation URL generated by another aries agent. + InvitationUrl string `json:"invitationUrl"` +} + +// NewAcceptInvitationV1Request instantiates a new AcceptInvitationV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAcceptInvitationV1Request(agentName string, invitationUrl string) *AcceptInvitationV1Request { + this := AcceptInvitationV1Request{} + this.AgentName = agentName + this.InvitationUrl = invitationUrl + return &this +} + +// NewAcceptInvitationV1RequestWithDefaults instantiates a new AcceptInvitationV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAcceptInvitationV1RequestWithDefaults() *AcceptInvitationV1Request { + this := AcceptInvitationV1Request{} + return &this +} + +// GetAgentName returns the AgentName field value +func (o *AcceptInvitationV1Request) GetAgentName() string { + if o == nil { + var ret string + return ret + } + + return o.AgentName +} + +// GetAgentNameOk returns a tuple with the AgentName field value +// and a boolean to check if the value has been set. +func (o *AcceptInvitationV1Request) GetAgentNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentName, true +} + +// SetAgentName sets field value +func (o *AcceptInvitationV1Request) SetAgentName(v string) { + o.AgentName = v +} + +// GetInvitationUrl returns the InvitationUrl field value +func (o *AcceptInvitationV1Request) GetInvitationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.InvitationUrl +} + +// GetInvitationUrlOk returns a tuple with the InvitationUrl field value +// and a boolean to check if the value has been set. +func (o *AcceptInvitationV1Request) GetInvitationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvitationUrl, true +} + +// SetInvitationUrl sets field value +func (o *AcceptInvitationV1Request) SetInvitationUrl(v string) { + o.InvitationUrl = v +} + +func (o AcceptInvitationV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AcceptInvitationV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["agentName"] = o.AgentName + toSerialize["invitationUrl"] = o.InvitationUrl + return toSerialize, nil +} + +type NullableAcceptInvitationV1Request struct { + value *AcceptInvitationV1Request + isSet bool +} + +func (v NullableAcceptInvitationV1Request) Get() *AcceptInvitationV1Request { + return v.value +} + +func (v *NullableAcceptInvitationV1Request) Set(val *AcceptInvitationV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableAcceptInvitationV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableAcceptInvitationV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAcceptInvitationV1Request(val *AcceptInvitationV1Request) *NullableAcceptInvitationV1Request { + return &NullableAcceptInvitationV1Request{value: val, isSet: true} +} + +func (v NullableAcceptInvitationV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAcceptInvitationV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_response.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_response.go new file mode 100644 index 00000000000..e81a4bdf14b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_accept_invitation_v1_response.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AcceptInvitationV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AcceptInvitationV1Response{} + +// AcceptInvitationV1Response Response for AcceptInvitation endpoint. +type AcceptInvitationV1Response struct { + // ID that can be used to track status of the connection + OutOfBandId string `json:"outOfBandId"` +} + +// NewAcceptInvitationV1Response instantiates a new AcceptInvitationV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAcceptInvitationV1Response(outOfBandId string) *AcceptInvitationV1Response { + this := AcceptInvitationV1Response{} + this.OutOfBandId = outOfBandId + return &this +} + +// NewAcceptInvitationV1ResponseWithDefaults instantiates a new AcceptInvitationV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAcceptInvitationV1ResponseWithDefaults() *AcceptInvitationV1Response { + this := AcceptInvitationV1Response{} + return &this +} + +// GetOutOfBandId returns the OutOfBandId field value +func (o *AcceptInvitationV1Response) GetOutOfBandId() string { + if o == nil { + var ret string + return ret + } + + return o.OutOfBandId +} + +// GetOutOfBandIdOk returns a tuple with the OutOfBandId field value +// and a boolean to check if the value has been set. +func (o *AcceptInvitationV1Response) GetOutOfBandIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutOfBandId, true +} + +// SetOutOfBandId sets field value +func (o *AcceptInvitationV1Response) SetOutOfBandId(v string) { + o.OutOfBandId = v +} + +func (o AcceptInvitationV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AcceptInvitationV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["outOfBandId"] = o.OutOfBandId + return toSerialize, nil +} + +type NullableAcceptInvitationV1Response struct { + value *AcceptInvitationV1Response + isSet bool +} + +func (v NullableAcceptInvitationV1Response) Get() *AcceptInvitationV1Response { + return v.value +} + +func (v *NullableAcceptInvitationV1Response) Set(val *AcceptInvitationV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableAcceptInvitationV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableAcceptInvitationV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAcceptInvitationV1Response(val *AcceptInvitationV1Response) *NullableAcceptInvitationV1Response { + return &NullableAcceptInvitationV1Response{value: val, isSet: true} +} + +func (v NullableAcceptInvitationV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAcceptInvitationV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connection_record_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connection_record_v1.go new file mode 100644 index 00000000000..7284e95079c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connection_record_v1.go @@ -0,0 +1,494 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AgentConnectionRecordV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentConnectionRecordV1{} + +// AgentConnectionRecordV1 Aries agent connection information. +type AgentConnectionRecordV1 struct { + State string `json:"state"` + Role string `json:"role"` + IsReady bool `json:"isReady"` + Did *string `json:"did,omitempty"` + TheirDid *string `json:"theirDid,omitempty"` + TheirLabel *string `json:"theirLabel,omitempty"` + Alias *string `json:"alias,omitempty"` + ThreadId *string `json:"threadId,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + OutOfBandId *string `json:"outOfBandId,omitempty"` + InvitationDid *string `json:"invitationDid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AgentConnectionRecordV1 AgentConnectionRecordV1 + +// NewAgentConnectionRecordV1 instantiates a new AgentConnectionRecordV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentConnectionRecordV1(state string, role string, isReady bool) *AgentConnectionRecordV1 { + this := AgentConnectionRecordV1{} + this.State = state + this.Role = role + this.IsReady = isReady + return &this +} + +// NewAgentConnectionRecordV1WithDefaults instantiates a new AgentConnectionRecordV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentConnectionRecordV1WithDefaults() *AgentConnectionRecordV1 { + this := AgentConnectionRecordV1{} + return &this +} + +// GetState returns the State field value +func (o *AgentConnectionRecordV1) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *AgentConnectionRecordV1) SetState(v string) { + o.State = v +} + +// GetRole returns the Role field value +func (o *AgentConnectionRecordV1) GetRole() string { + if o == nil { + var ret string + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *AgentConnectionRecordV1) SetRole(v string) { + o.Role = v +} + +// GetIsReady returns the IsReady field value +func (o *AgentConnectionRecordV1) GetIsReady() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsReady +} + +// GetIsReadyOk returns a tuple with the IsReady field value +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetIsReadyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsReady, true +} + +// SetIsReady sets field value +func (o *AgentConnectionRecordV1) SetIsReady(v bool) { + o.IsReady = v +} + +// GetDid returns the Did field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetDid() string { + if o == nil || IsNil(o.Did) { + var ret string + return ret + } + return *o.Did +} + +// GetDidOk returns a tuple with the Did field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetDidOk() (*string, bool) { + if o == nil || IsNil(o.Did) { + return nil, false + } + return o.Did, true +} + +// HasDid returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasDid() bool { + if o != nil && !IsNil(o.Did) { + return true + } + + return false +} + +// SetDid gets a reference to the given string and assigns it to the Did field. +func (o *AgentConnectionRecordV1) SetDid(v string) { + o.Did = &v +} + +// GetTheirDid returns the TheirDid field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetTheirDid() string { + if o == nil || IsNil(o.TheirDid) { + var ret string + return ret + } + return *o.TheirDid +} + +// GetTheirDidOk returns a tuple with the TheirDid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetTheirDidOk() (*string, bool) { + if o == nil || IsNil(o.TheirDid) { + return nil, false + } + return o.TheirDid, true +} + +// HasTheirDid returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasTheirDid() bool { + if o != nil && !IsNil(o.TheirDid) { + return true + } + + return false +} + +// SetTheirDid gets a reference to the given string and assigns it to the TheirDid field. +func (o *AgentConnectionRecordV1) SetTheirDid(v string) { + o.TheirDid = &v +} + +// GetTheirLabel returns the TheirLabel field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetTheirLabel() string { + if o == nil || IsNil(o.TheirLabel) { + var ret string + return ret + } + return *o.TheirLabel +} + +// GetTheirLabelOk returns a tuple with the TheirLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetTheirLabelOk() (*string, bool) { + if o == nil || IsNil(o.TheirLabel) { + return nil, false + } + return o.TheirLabel, true +} + +// HasTheirLabel returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasTheirLabel() bool { + if o != nil && !IsNil(o.TheirLabel) { + return true + } + + return false +} + +// SetTheirLabel gets a reference to the given string and assigns it to the TheirLabel field. +func (o *AgentConnectionRecordV1) SetTheirLabel(v string) { + o.TheirLabel = &v +} + +// GetAlias returns the Alias field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetAlias() string { + if o == nil || IsNil(o.Alias) { + var ret string + return ret + } + return *o.Alias +} + +// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetAliasOk() (*string, bool) { + if o == nil || IsNil(o.Alias) { + return nil, false + } + return o.Alias, true +} + +// HasAlias returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasAlias() bool { + if o != nil && !IsNil(o.Alias) { + return true + } + + return false +} + +// SetAlias gets a reference to the given string and assigns it to the Alias field. +func (o *AgentConnectionRecordV1) SetAlias(v string) { + o.Alias = &v +} + +// GetThreadId returns the ThreadId field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetThreadId() string { + if o == nil || IsNil(o.ThreadId) { + var ret string + return ret + } + return *o.ThreadId +} + +// GetThreadIdOk returns a tuple with the ThreadId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetThreadIdOk() (*string, bool) { + if o == nil || IsNil(o.ThreadId) { + return nil, false + } + return o.ThreadId, true +} + +// HasThreadId returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasThreadId() bool { + if o != nil && !IsNil(o.ThreadId) { + return true + } + + return false +} + +// SetThreadId gets a reference to the given string and assigns it to the ThreadId field. +func (o *AgentConnectionRecordV1) SetThreadId(v string) { + o.ThreadId = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *AgentConnectionRecordV1) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetOutOfBandId returns the OutOfBandId field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetOutOfBandId() string { + if o == nil || IsNil(o.OutOfBandId) { + var ret string + return ret + } + return *o.OutOfBandId +} + +// GetOutOfBandIdOk returns a tuple with the OutOfBandId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetOutOfBandIdOk() (*string, bool) { + if o == nil || IsNil(o.OutOfBandId) { + return nil, false + } + return o.OutOfBandId, true +} + +// HasOutOfBandId returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasOutOfBandId() bool { + if o != nil && !IsNil(o.OutOfBandId) { + return true + } + + return false +} + +// SetOutOfBandId gets a reference to the given string and assigns it to the OutOfBandId field. +func (o *AgentConnectionRecordV1) SetOutOfBandId(v string) { + o.OutOfBandId = &v +} + +// GetInvitationDid returns the InvitationDid field value if set, zero value otherwise. +func (o *AgentConnectionRecordV1) GetInvitationDid() string { + if o == nil || IsNil(o.InvitationDid) { + var ret string + return ret + } + return *o.InvitationDid +} + +// GetInvitationDidOk returns a tuple with the InvitationDid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionRecordV1) GetInvitationDidOk() (*string, bool) { + if o == nil || IsNil(o.InvitationDid) { + return nil, false + } + return o.InvitationDid, true +} + +// HasInvitationDid returns a boolean if a field has been set. +func (o *AgentConnectionRecordV1) HasInvitationDid() bool { + if o != nil && !IsNil(o.InvitationDid) { + return true + } + + return false +} + +// SetInvitationDid gets a reference to the given string and assigns it to the InvitationDid field. +func (o *AgentConnectionRecordV1) SetInvitationDid(v string) { + o.InvitationDid = &v +} + +func (o AgentConnectionRecordV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentConnectionRecordV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["state"] = o.State + toSerialize["role"] = o.Role + toSerialize["isReady"] = o.IsReady + if !IsNil(o.Did) { + toSerialize["did"] = o.Did + } + if !IsNil(o.TheirDid) { + toSerialize["theirDid"] = o.TheirDid + } + if !IsNil(o.TheirLabel) { + toSerialize["theirLabel"] = o.TheirLabel + } + if !IsNil(o.Alias) { + toSerialize["alias"] = o.Alias + } + if !IsNil(o.ThreadId) { + toSerialize["threadId"] = o.ThreadId + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.OutOfBandId) { + toSerialize["outOfBandId"] = o.OutOfBandId + } + if !IsNil(o.InvitationDid) { + toSerialize["invitationDid"] = o.InvitationDid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentConnectionRecordV1) UnmarshalJSON(bytes []byte) (err error) { + varAgentConnectionRecordV1 := _AgentConnectionRecordV1{} + + if err = json.Unmarshal(bytes, &varAgentConnectionRecordV1); err == nil { + *o = AgentConnectionRecordV1(varAgentConnectionRecordV1) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "state") + delete(additionalProperties, "role") + delete(additionalProperties, "isReady") + delete(additionalProperties, "did") + delete(additionalProperties, "theirDid") + delete(additionalProperties, "theirLabel") + delete(additionalProperties, "alias") + delete(additionalProperties, "threadId") + delete(additionalProperties, "errorMessage") + delete(additionalProperties, "outOfBandId") + delete(additionalProperties, "invitationDid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentConnectionRecordV1 struct { + value *AgentConnectionRecordV1 + isSet bool +} + +func (v NullableAgentConnectionRecordV1) Get() *AgentConnectionRecordV1 { + return v.value +} + +func (v *NullableAgentConnectionRecordV1) Set(val *AgentConnectionRecordV1) { + v.value = val + v.isSet = true +} + +func (v NullableAgentConnectionRecordV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentConnectionRecordV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentConnectionRecordV1(val *AgentConnectionRecordV1) *NullableAgentConnectionRecordV1 { + return &NullableAgentConnectionRecordV1{value: val, isSet: true} +} + +func (v NullableAgentConnectionRecordV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentConnectionRecordV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connections_filter_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connections_filter_v1.go new file mode 100644 index 00000000000..d646d8eed63 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_agent_connections_filter_v1.go @@ -0,0 +1,342 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AgentConnectionsFilterV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentConnectionsFilterV1{} + +// AgentConnectionsFilterV1 Fields that can be used to filter agent connection list. +type AgentConnectionsFilterV1 struct { + Did *string `json:"did,omitempty"` + InvitationDid *string `json:"invitationDid,omitempty"` + OutOfBandId *string `json:"outOfBandId,omitempty"` + Role *string `json:"role,omitempty"` + State *string `json:"state,omitempty"` + TheirDid *string `json:"theirDid,omitempty"` + ThreadId *string `json:"threadId,omitempty"` +} + +// NewAgentConnectionsFilterV1 instantiates a new AgentConnectionsFilterV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentConnectionsFilterV1() *AgentConnectionsFilterV1 { + this := AgentConnectionsFilterV1{} + return &this +} + +// NewAgentConnectionsFilterV1WithDefaults instantiates a new AgentConnectionsFilterV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentConnectionsFilterV1WithDefaults() *AgentConnectionsFilterV1 { + this := AgentConnectionsFilterV1{} + return &this +} + +// GetDid returns the Did field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) GetDid() string { + if o == nil || IsNil(o.Did) { + var ret string + return ret + } + return *o.Did +} + +// GetDidOk returns a tuple with the Did field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionsFilterV1) GetDidOk() (*string, bool) { + if o == nil || IsNil(o.Did) { + return nil, false + } + return o.Did, true +} + +// HasDid returns a boolean if a field has been set. +func (o *AgentConnectionsFilterV1) HasDid() bool { + if o != nil && !IsNil(o.Did) { + return true + } + + return false +} + +// SetDid gets a reference to the given string and assigns it to the Did field. +func (o *AgentConnectionsFilterV1) SetDid(v string) { + o.Did = &v +} + +// GetInvitationDid returns the InvitationDid field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) GetInvitationDid() string { + if o == nil || IsNil(o.InvitationDid) { + var ret string + return ret + } + return *o.InvitationDid +} + +// GetInvitationDidOk returns a tuple with the InvitationDid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionsFilterV1) GetInvitationDidOk() (*string, bool) { + if o == nil || IsNil(o.InvitationDid) { + return nil, false + } + return o.InvitationDid, true +} + +// HasInvitationDid returns a boolean if a field has been set. +func (o *AgentConnectionsFilterV1) HasInvitationDid() bool { + if o != nil && !IsNil(o.InvitationDid) { + return true + } + + return false +} + +// SetInvitationDid gets a reference to the given string and assigns it to the InvitationDid field. +func (o *AgentConnectionsFilterV1) SetInvitationDid(v string) { + o.InvitationDid = &v +} + +// GetOutOfBandId returns the OutOfBandId field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) GetOutOfBandId() string { + if o == nil || IsNil(o.OutOfBandId) { + var ret string + return ret + } + return *o.OutOfBandId +} + +// GetOutOfBandIdOk returns a tuple with the OutOfBandId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionsFilterV1) GetOutOfBandIdOk() (*string, bool) { + if o == nil || IsNil(o.OutOfBandId) { + return nil, false + } + return o.OutOfBandId, true +} + +// HasOutOfBandId returns a boolean if a field has been set. +func (o *AgentConnectionsFilterV1) HasOutOfBandId() bool { + if o != nil && !IsNil(o.OutOfBandId) { + return true + } + + return false +} + +// SetOutOfBandId gets a reference to the given string and assigns it to the OutOfBandId field. +func (o *AgentConnectionsFilterV1) SetOutOfBandId(v string) { + o.OutOfBandId = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionsFilterV1) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *AgentConnectionsFilterV1) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *AgentConnectionsFilterV1) SetRole(v string) { + o.Role = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) 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 *AgentConnectionsFilterV1) 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 *AgentConnectionsFilterV1) 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 *AgentConnectionsFilterV1) SetState(v string) { + o.State = &v +} + +// GetTheirDid returns the TheirDid field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) GetTheirDid() string { + if o == nil || IsNil(o.TheirDid) { + var ret string + return ret + } + return *o.TheirDid +} + +// GetTheirDidOk returns a tuple with the TheirDid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionsFilterV1) GetTheirDidOk() (*string, bool) { + if o == nil || IsNil(o.TheirDid) { + return nil, false + } + return o.TheirDid, true +} + +// HasTheirDid returns a boolean if a field has been set. +func (o *AgentConnectionsFilterV1) HasTheirDid() bool { + if o != nil && !IsNil(o.TheirDid) { + return true + } + + return false +} + +// SetTheirDid gets a reference to the given string and assigns it to the TheirDid field. +func (o *AgentConnectionsFilterV1) SetTheirDid(v string) { + o.TheirDid = &v +} + +// GetThreadId returns the ThreadId field value if set, zero value otherwise. +func (o *AgentConnectionsFilterV1) GetThreadId() string { + if o == nil || IsNil(o.ThreadId) { + var ret string + return ret + } + return *o.ThreadId +} + +// GetThreadIdOk returns a tuple with the ThreadId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectionsFilterV1) GetThreadIdOk() (*string, bool) { + if o == nil || IsNil(o.ThreadId) { + return nil, false + } + return o.ThreadId, true +} + +// HasThreadId returns a boolean if a field has been set. +func (o *AgentConnectionsFilterV1) HasThreadId() bool { + if o != nil && !IsNil(o.ThreadId) { + return true + } + + return false +} + +// SetThreadId gets a reference to the given string and assigns it to the ThreadId field. +func (o *AgentConnectionsFilterV1) SetThreadId(v string) { + o.ThreadId = &v +} + +func (o AgentConnectionsFilterV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentConnectionsFilterV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Did) { + toSerialize["did"] = o.Did + } + if !IsNil(o.InvitationDid) { + toSerialize["invitationDid"] = o.InvitationDid + } + if !IsNil(o.OutOfBandId) { + toSerialize["outOfBandId"] = o.OutOfBandId + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.TheirDid) { + toSerialize["theirDid"] = o.TheirDid + } + if !IsNil(o.ThreadId) { + toSerialize["threadId"] = o.ThreadId + } + return toSerialize, nil +} + +type NullableAgentConnectionsFilterV1 struct { + value *AgentConnectionsFilterV1 + isSet bool +} + +func (v NullableAgentConnectionsFilterV1) Get() *AgentConnectionsFilterV1 { + return v.value +} + +func (v *NullableAgentConnectionsFilterV1) Set(val *AgentConnectionsFilterV1) { + v.value = val + v.isSet = true +} + +func (v NullableAgentConnectionsFilterV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentConnectionsFilterV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentConnectionsFilterV1(val *AgentConnectionsFilterV1) *NullableAgentConnectionsFilterV1 { + return &NullableAgentConnectionsFilterV1{value: val, isSet: true} +} + +func (v NullableAgentConnectionsFilterV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentConnectionsFilterV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_config_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_config_v1.go new file mode 100644 index 00000000000..62466a9cc1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_config_v1.go @@ -0,0 +1,364 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AriesAgentConfigV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AriesAgentConfigV1{} + +// AriesAgentConfigV1 Aries agent configuration to be setup and used by the connector. +type AriesAgentConfigV1 struct { + // Aries agent label that will also be used as wallet id. + Name string `json:"name"` + // Wallet private key - do not share with anyone. + WalletKey string `json:"walletKey"` + // Path to wallet sqlite database to use. If not provided, the connector default path and agent name will be used. + WalletPath *string `json:"walletPath,omitempty"` + IndyNetworks []AriesIndyVdrPoolConfigV1 `json:"indyNetworks"` + // Inbound endpoint URL for this agent. Must be unique for this connector. Must contain port. + InboundUrl *string `json:"inboundUrl,omitempty"` + // Flag to accept new connection by default + AutoAcceptConnections *bool `json:"autoAcceptConnections,omitempty"` + AutoAcceptCredentials *CactiAcceptPolicyV1 `json:"autoAcceptCredentials,omitempty"` + AutoAcceptProofs *CactiAcceptPolicyV1 `json:"autoAcceptProofs,omitempty"` +} + +// NewAriesAgentConfigV1 instantiates a new AriesAgentConfigV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAriesAgentConfigV1(name string, walletKey string, indyNetworks []AriesIndyVdrPoolConfigV1) *AriesAgentConfigV1 { + this := AriesAgentConfigV1{} + this.Name = name + this.WalletKey = walletKey + this.IndyNetworks = indyNetworks + var inboundUrl string = "undefined" + this.InboundUrl = &inboundUrl + var autoAcceptConnections bool = false + this.AutoAcceptConnections = &autoAcceptConnections + return &this +} + +// NewAriesAgentConfigV1WithDefaults instantiates a new AriesAgentConfigV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAriesAgentConfigV1WithDefaults() *AriesAgentConfigV1 { + this := AriesAgentConfigV1{} + var inboundUrl string = "undefined" + this.InboundUrl = &inboundUrl + var autoAcceptConnections bool = false + this.AutoAcceptConnections = &autoAcceptConnections + return &this +} + +// GetName returns the Name field value +func (o *AriesAgentConfigV1) 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 *AriesAgentConfigV1) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AriesAgentConfigV1) SetName(v string) { + o.Name = v +} + +// GetWalletKey returns the WalletKey field value +func (o *AriesAgentConfigV1) GetWalletKey() string { + if o == nil { + var ret string + return ret + } + + return o.WalletKey +} + +// GetWalletKeyOk returns a tuple with the WalletKey field value +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetWalletKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.WalletKey, true +} + +// SetWalletKey sets field value +func (o *AriesAgentConfigV1) SetWalletKey(v string) { + o.WalletKey = v +} + +// GetWalletPath returns the WalletPath field value if set, zero value otherwise. +func (o *AriesAgentConfigV1) GetWalletPath() string { + if o == nil || IsNil(o.WalletPath) { + var ret string + return ret + } + return *o.WalletPath +} + +// GetWalletPathOk returns a tuple with the WalletPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetWalletPathOk() (*string, bool) { + if o == nil || IsNil(o.WalletPath) { + return nil, false + } + return o.WalletPath, true +} + +// HasWalletPath returns a boolean if a field has been set. +func (o *AriesAgentConfigV1) HasWalletPath() bool { + if o != nil && !IsNil(o.WalletPath) { + return true + } + + return false +} + +// SetWalletPath gets a reference to the given string and assigns it to the WalletPath field. +func (o *AriesAgentConfigV1) SetWalletPath(v string) { + o.WalletPath = &v +} + +// GetIndyNetworks returns the IndyNetworks field value +func (o *AriesAgentConfigV1) GetIndyNetworks() []AriesIndyVdrPoolConfigV1 { + if o == nil { + var ret []AriesIndyVdrPoolConfigV1 + return ret + } + + return o.IndyNetworks +} + +// GetIndyNetworksOk returns a tuple with the IndyNetworks field value +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetIndyNetworksOk() ([]AriesIndyVdrPoolConfigV1, bool) { + if o == nil { + return nil, false + } + return o.IndyNetworks, true +} + +// SetIndyNetworks sets field value +func (o *AriesAgentConfigV1) SetIndyNetworks(v []AriesIndyVdrPoolConfigV1) { + o.IndyNetworks = v +} + +// GetInboundUrl returns the InboundUrl field value if set, zero value otherwise. +func (o *AriesAgentConfigV1) GetInboundUrl() string { + if o == nil || IsNil(o.InboundUrl) { + var ret string + return ret + } + return *o.InboundUrl +} + +// GetInboundUrlOk returns a tuple with the InboundUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetInboundUrlOk() (*string, bool) { + if o == nil || IsNil(o.InboundUrl) { + return nil, false + } + return o.InboundUrl, true +} + +// HasInboundUrl returns a boolean if a field has been set. +func (o *AriesAgentConfigV1) HasInboundUrl() bool { + if o != nil && !IsNil(o.InboundUrl) { + return true + } + + return false +} + +// SetInboundUrl gets a reference to the given string and assigns it to the InboundUrl field. +func (o *AriesAgentConfigV1) SetInboundUrl(v string) { + o.InboundUrl = &v +} + +// GetAutoAcceptConnections returns the AutoAcceptConnections field value if set, zero value otherwise. +func (o *AriesAgentConfigV1) GetAutoAcceptConnections() bool { + if o == nil || IsNil(o.AutoAcceptConnections) { + var ret bool + return ret + } + return *o.AutoAcceptConnections +} + +// GetAutoAcceptConnectionsOk returns a tuple with the AutoAcceptConnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetAutoAcceptConnectionsOk() (*bool, bool) { + if o == nil || IsNil(o.AutoAcceptConnections) { + return nil, false + } + return o.AutoAcceptConnections, true +} + +// HasAutoAcceptConnections returns a boolean if a field has been set. +func (o *AriesAgentConfigV1) HasAutoAcceptConnections() bool { + if o != nil && !IsNil(o.AutoAcceptConnections) { + return true + } + + return false +} + +// SetAutoAcceptConnections gets a reference to the given bool and assigns it to the AutoAcceptConnections field. +func (o *AriesAgentConfigV1) SetAutoAcceptConnections(v bool) { + o.AutoAcceptConnections = &v +} + +// GetAutoAcceptCredentials returns the AutoAcceptCredentials field value if set, zero value otherwise. +func (o *AriesAgentConfigV1) GetAutoAcceptCredentials() CactiAcceptPolicyV1 { + if o == nil || IsNil(o.AutoAcceptCredentials) { + var ret CactiAcceptPolicyV1 + return ret + } + return *o.AutoAcceptCredentials +} + +// GetAutoAcceptCredentialsOk returns a tuple with the AutoAcceptCredentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetAutoAcceptCredentialsOk() (*CactiAcceptPolicyV1, bool) { + if o == nil || IsNil(o.AutoAcceptCredentials) { + return nil, false + } + return o.AutoAcceptCredentials, true +} + +// HasAutoAcceptCredentials returns a boolean if a field has been set. +func (o *AriesAgentConfigV1) HasAutoAcceptCredentials() bool { + if o != nil && !IsNil(o.AutoAcceptCredentials) { + return true + } + + return false +} + +// SetAutoAcceptCredentials gets a reference to the given CactiAcceptPolicyV1 and assigns it to the AutoAcceptCredentials field. +func (o *AriesAgentConfigV1) SetAutoAcceptCredentials(v CactiAcceptPolicyV1) { + o.AutoAcceptCredentials = &v +} + +// GetAutoAcceptProofs returns the AutoAcceptProofs field value if set, zero value otherwise. +func (o *AriesAgentConfigV1) GetAutoAcceptProofs() CactiAcceptPolicyV1 { + if o == nil || IsNil(o.AutoAcceptProofs) { + var ret CactiAcceptPolicyV1 + return ret + } + return *o.AutoAcceptProofs +} + +// GetAutoAcceptProofsOk returns a tuple with the AutoAcceptProofs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesAgentConfigV1) GetAutoAcceptProofsOk() (*CactiAcceptPolicyV1, bool) { + if o == nil || IsNil(o.AutoAcceptProofs) { + return nil, false + } + return o.AutoAcceptProofs, true +} + +// HasAutoAcceptProofs returns a boolean if a field has been set. +func (o *AriesAgentConfigV1) HasAutoAcceptProofs() bool { + if o != nil && !IsNil(o.AutoAcceptProofs) { + return true + } + + return false +} + +// SetAutoAcceptProofs gets a reference to the given CactiAcceptPolicyV1 and assigns it to the AutoAcceptProofs field. +func (o *AriesAgentConfigV1) SetAutoAcceptProofs(v CactiAcceptPolicyV1) { + o.AutoAcceptProofs = &v +} + +func (o AriesAgentConfigV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AriesAgentConfigV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["walletKey"] = o.WalletKey + if !IsNil(o.WalletPath) { + toSerialize["walletPath"] = o.WalletPath + } + toSerialize["indyNetworks"] = o.IndyNetworks + if !IsNil(o.InboundUrl) { + toSerialize["inboundUrl"] = o.InboundUrl + } + if !IsNil(o.AutoAcceptConnections) { + toSerialize["autoAcceptConnections"] = o.AutoAcceptConnections + } + if !IsNil(o.AutoAcceptCredentials) { + toSerialize["autoAcceptCredentials"] = o.AutoAcceptCredentials + } + if !IsNil(o.AutoAcceptProofs) { + toSerialize["autoAcceptProofs"] = o.AutoAcceptProofs + } + return toSerialize, nil +} + +type NullableAriesAgentConfigV1 struct { + value *AriesAgentConfigV1 + isSet bool +} + +func (v NullableAriesAgentConfigV1) Get() *AriesAgentConfigV1 { + return v.value +} + +func (v *NullableAriesAgentConfigV1) Set(val *AriesAgentConfigV1) { + v.value = val + v.isSet = true +} + +func (v NullableAriesAgentConfigV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAriesAgentConfigV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAriesAgentConfigV1(val *AriesAgentConfigV1) *NullableAriesAgentConfigV1 { + return &NullableAriesAgentConfigV1{value: val, isSet: true} +} + +func (v NullableAriesAgentConfigV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAriesAgentConfigV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1.go new file mode 100644 index 00000000000..306c92efa54 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1.go @@ -0,0 +1,257 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AriesAgentSummaryV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AriesAgentSummaryV1{} + +// AriesAgentSummaryV1 Summary of an Aries Agent configured in the connector. +type AriesAgentSummaryV1 struct { + // Aries label of an agent + Name string `json:"name"` + // True when Aries agent has been initialized properly. + IsAgentInitialized bool `json:"isAgentInitialized"` + // True when this agents wallet has been initialized properly. + IsWalletInitialized bool `json:"isWalletInitialized"` + // True when this agents wallet has been provisioned properly. + IsWalletProvisioned bool `json:"isWalletProvisioned"` + WalletConfig AriesAgentSummaryV1WalletConfig `json:"walletConfig"` + // Aries agent endpoints configured + Endpoints []string `json:"endpoints"` +} + +// NewAriesAgentSummaryV1 instantiates a new AriesAgentSummaryV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAriesAgentSummaryV1(name string, isAgentInitialized bool, isWalletInitialized bool, isWalletProvisioned bool, walletConfig AriesAgentSummaryV1WalletConfig, endpoints []string) *AriesAgentSummaryV1 { + this := AriesAgentSummaryV1{} + this.Name = name + this.IsAgentInitialized = isAgentInitialized + this.IsWalletInitialized = isWalletInitialized + this.IsWalletProvisioned = isWalletProvisioned + this.WalletConfig = walletConfig + this.Endpoints = endpoints + return &this +} + +// NewAriesAgentSummaryV1WithDefaults instantiates a new AriesAgentSummaryV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAriesAgentSummaryV1WithDefaults() *AriesAgentSummaryV1 { + this := AriesAgentSummaryV1{} + return &this +} + +// GetName returns the Name field value +func (o *AriesAgentSummaryV1) 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 *AriesAgentSummaryV1) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AriesAgentSummaryV1) SetName(v string) { + o.Name = v +} + +// GetIsAgentInitialized returns the IsAgentInitialized field value +func (o *AriesAgentSummaryV1) GetIsAgentInitialized() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsAgentInitialized +} + +// GetIsAgentInitializedOk returns a tuple with the IsAgentInitialized field value +// and a boolean to check if the value has been set. +func (o *AriesAgentSummaryV1) GetIsAgentInitializedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsAgentInitialized, true +} + +// SetIsAgentInitialized sets field value +func (o *AriesAgentSummaryV1) SetIsAgentInitialized(v bool) { + o.IsAgentInitialized = v +} + +// GetIsWalletInitialized returns the IsWalletInitialized field value +func (o *AriesAgentSummaryV1) GetIsWalletInitialized() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsWalletInitialized +} + +// GetIsWalletInitializedOk returns a tuple with the IsWalletInitialized field value +// and a boolean to check if the value has been set. +func (o *AriesAgentSummaryV1) GetIsWalletInitializedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsWalletInitialized, true +} + +// SetIsWalletInitialized sets field value +func (o *AriesAgentSummaryV1) SetIsWalletInitialized(v bool) { + o.IsWalletInitialized = v +} + +// GetIsWalletProvisioned returns the IsWalletProvisioned field value +func (o *AriesAgentSummaryV1) GetIsWalletProvisioned() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsWalletProvisioned +} + +// GetIsWalletProvisionedOk returns a tuple with the IsWalletProvisioned field value +// and a boolean to check if the value has been set. +func (o *AriesAgentSummaryV1) GetIsWalletProvisionedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsWalletProvisioned, true +} + +// SetIsWalletProvisioned sets field value +func (o *AriesAgentSummaryV1) SetIsWalletProvisioned(v bool) { + o.IsWalletProvisioned = v +} + +// GetWalletConfig returns the WalletConfig field value +func (o *AriesAgentSummaryV1) GetWalletConfig() AriesAgentSummaryV1WalletConfig { + if o == nil { + var ret AriesAgentSummaryV1WalletConfig + return ret + } + + return o.WalletConfig +} + +// GetWalletConfigOk returns a tuple with the WalletConfig field value +// and a boolean to check if the value has been set. +func (o *AriesAgentSummaryV1) GetWalletConfigOk() (*AriesAgentSummaryV1WalletConfig, bool) { + if o == nil { + return nil, false + } + return &o.WalletConfig, true +} + +// SetWalletConfig sets field value +func (o *AriesAgentSummaryV1) SetWalletConfig(v AriesAgentSummaryV1WalletConfig) { + o.WalletConfig = v +} + +// GetEndpoints returns the Endpoints field value +func (o *AriesAgentSummaryV1) GetEndpoints() []string { + if o == nil { + var ret []string + return ret + } + + return o.Endpoints +} + +// GetEndpointsOk returns a tuple with the Endpoints field value +// and a boolean to check if the value has been set. +func (o *AriesAgentSummaryV1) GetEndpointsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Endpoints, true +} + +// SetEndpoints sets field value +func (o *AriesAgentSummaryV1) SetEndpoints(v []string) { + o.Endpoints = v +} + +func (o AriesAgentSummaryV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AriesAgentSummaryV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["isAgentInitialized"] = o.IsAgentInitialized + toSerialize["isWalletInitialized"] = o.IsWalletInitialized + toSerialize["isWalletProvisioned"] = o.IsWalletProvisioned + toSerialize["walletConfig"] = o.WalletConfig + toSerialize["endpoints"] = o.Endpoints + return toSerialize, nil +} + +type NullableAriesAgentSummaryV1 struct { + value *AriesAgentSummaryV1 + isSet bool +} + +func (v NullableAriesAgentSummaryV1) Get() *AriesAgentSummaryV1 { + return v.value +} + +func (v *NullableAriesAgentSummaryV1) Set(val *AriesAgentSummaryV1) { + v.value = val + v.isSet = true +} + +func (v NullableAriesAgentSummaryV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAriesAgentSummaryV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAriesAgentSummaryV1(val *AriesAgentSummaryV1) *NullableAriesAgentSummaryV1 { + return &NullableAriesAgentSummaryV1{value: val, isSet: true} +} + +func (v NullableAriesAgentSummaryV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAriesAgentSummaryV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1_wallet_config.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1_wallet_config.go new file mode 100644 index 00000000000..6adaa81f961 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_agent_summary_v1_wallet_config.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AriesAgentSummaryV1WalletConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AriesAgentSummaryV1WalletConfig{} + +// AriesAgentSummaryV1WalletConfig struct for AriesAgentSummaryV1WalletConfig +type AriesAgentSummaryV1WalletConfig struct { + // Wallet entry ID + Id string `json:"id"` + // Wallet storage type + Type string `json:"type"` +} + +// NewAriesAgentSummaryV1WalletConfig instantiates a new AriesAgentSummaryV1WalletConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAriesAgentSummaryV1WalletConfig(id string, type_ string) *AriesAgentSummaryV1WalletConfig { + this := AriesAgentSummaryV1WalletConfig{} + this.Id = id + this.Type = type_ + return &this +} + +// NewAriesAgentSummaryV1WalletConfigWithDefaults instantiates a new AriesAgentSummaryV1WalletConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAriesAgentSummaryV1WalletConfigWithDefaults() *AriesAgentSummaryV1WalletConfig { + this := AriesAgentSummaryV1WalletConfig{} + return &this +} + +// GetId returns the Id field value +func (o *AriesAgentSummaryV1WalletConfig) 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 *AriesAgentSummaryV1WalletConfig) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *AriesAgentSummaryV1WalletConfig) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *AriesAgentSummaryV1WalletConfig) 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 *AriesAgentSummaryV1WalletConfig) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *AriesAgentSummaryV1WalletConfig) SetType(v string) { + o.Type = v +} + +func (o AriesAgentSummaryV1WalletConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AriesAgentSummaryV1WalletConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +type NullableAriesAgentSummaryV1WalletConfig struct { + value *AriesAgentSummaryV1WalletConfig + isSet bool +} + +func (v NullableAriesAgentSummaryV1WalletConfig) Get() *AriesAgentSummaryV1WalletConfig { + return v.value +} + +func (v *NullableAriesAgentSummaryV1WalletConfig) Set(val *AriesAgentSummaryV1WalletConfig) { + v.value = val + v.isSet = true +} + +func (v NullableAriesAgentSummaryV1WalletConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableAriesAgentSummaryV1WalletConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAriesAgentSummaryV1WalletConfig(val *AriesAgentSummaryV1WalletConfig) *NullableAriesAgentSummaryV1WalletConfig { + return &NullableAriesAgentSummaryV1WalletConfig{value: val, isSet: true} +} + +func (v NullableAriesAgentSummaryV1WalletConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAriesAgentSummaryV1WalletConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_indy_vdr_pool_config_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_indy_vdr_pool_config_v1.go new file mode 100644 index 00000000000..d086c51c23d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_indy_vdr_pool_config_v1.go @@ -0,0 +1,211 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AriesIndyVdrPoolConfigV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AriesIndyVdrPoolConfigV1{} + +// AriesIndyVdrPoolConfigV1 Indy VDR network configuration +type AriesIndyVdrPoolConfigV1 struct { + // Indy genesis transactions. + GenesisTransactions string `json:"genesisTransactions"` + // Flag to specify whether this is production or development ledger. + IsProduction bool `json:"isProduction"` + // Indy namespace + IndyNamespace string `json:"indyNamespace"` + // Connect to the ledger on startup flag + ConnectOnStartup *bool `json:"connectOnStartup,omitempty"` +} + +// NewAriesIndyVdrPoolConfigV1 instantiates a new AriesIndyVdrPoolConfigV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAriesIndyVdrPoolConfigV1(genesisTransactions string, isProduction bool, indyNamespace string) *AriesIndyVdrPoolConfigV1 { + this := AriesIndyVdrPoolConfigV1{} + this.GenesisTransactions = genesisTransactions + this.IsProduction = isProduction + this.IndyNamespace = indyNamespace + return &this +} + +// NewAriesIndyVdrPoolConfigV1WithDefaults instantiates a new AriesIndyVdrPoolConfigV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAriesIndyVdrPoolConfigV1WithDefaults() *AriesIndyVdrPoolConfigV1 { + this := AriesIndyVdrPoolConfigV1{} + return &this +} + +// GetGenesisTransactions returns the GenesisTransactions field value +func (o *AriesIndyVdrPoolConfigV1) GetGenesisTransactions() string { + if o == nil { + var ret string + return ret + } + + return o.GenesisTransactions +} + +// GetGenesisTransactionsOk returns a tuple with the GenesisTransactions field value +// and a boolean to check if the value has been set. +func (o *AriesIndyVdrPoolConfigV1) GetGenesisTransactionsOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GenesisTransactions, true +} + +// SetGenesisTransactions sets field value +func (o *AriesIndyVdrPoolConfigV1) SetGenesisTransactions(v string) { + o.GenesisTransactions = v +} + +// GetIsProduction returns the IsProduction field value +func (o *AriesIndyVdrPoolConfigV1) GetIsProduction() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsProduction +} + +// GetIsProductionOk returns a tuple with the IsProduction field value +// and a boolean to check if the value has been set. +func (o *AriesIndyVdrPoolConfigV1) GetIsProductionOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsProduction, true +} + +// SetIsProduction sets field value +func (o *AriesIndyVdrPoolConfigV1) SetIsProduction(v bool) { + o.IsProduction = v +} + +// GetIndyNamespace returns the IndyNamespace field value +func (o *AriesIndyVdrPoolConfigV1) GetIndyNamespace() string { + if o == nil { + var ret string + return ret + } + + return o.IndyNamespace +} + +// GetIndyNamespaceOk returns a tuple with the IndyNamespace field value +// and a boolean to check if the value has been set. +func (o *AriesIndyVdrPoolConfigV1) GetIndyNamespaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IndyNamespace, true +} + +// SetIndyNamespace sets field value +func (o *AriesIndyVdrPoolConfigV1) SetIndyNamespace(v string) { + o.IndyNamespace = v +} + +// GetConnectOnStartup returns the ConnectOnStartup field value if set, zero value otherwise. +func (o *AriesIndyVdrPoolConfigV1) GetConnectOnStartup() bool { + if o == nil || IsNil(o.ConnectOnStartup) { + var ret bool + return ret + } + return *o.ConnectOnStartup +} + +// GetConnectOnStartupOk returns a tuple with the ConnectOnStartup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesIndyVdrPoolConfigV1) GetConnectOnStartupOk() (*bool, bool) { + if o == nil || IsNil(o.ConnectOnStartup) { + return nil, false + } + return o.ConnectOnStartup, true +} + +// HasConnectOnStartup returns a boolean if a field has been set. +func (o *AriesIndyVdrPoolConfigV1) HasConnectOnStartup() bool { + if o != nil && !IsNil(o.ConnectOnStartup) { + return true + } + + return false +} + +// SetConnectOnStartup gets a reference to the given bool and assigns it to the ConnectOnStartup field. +func (o *AriesIndyVdrPoolConfigV1) SetConnectOnStartup(v bool) { + o.ConnectOnStartup = &v +} + +func (o AriesIndyVdrPoolConfigV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AriesIndyVdrPoolConfigV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["genesisTransactions"] = o.GenesisTransactions + toSerialize["isProduction"] = o.IsProduction + toSerialize["indyNamespace"] = o.IndyNamespace + if !IsNil(o.ConnectOnStartup) { + toSerialize["connectOnStartup"] = o.ConnectOnStartup + } + return toSerialize, nil +} + +type NullableAriesIndyVdrPoolConfigV1 struct { + value *AriesIndyVdrPoolConfigV1 + isSet bool +} + +func (v NullableAriesIndyVdrPoolConfigV1) Get() *AriesIndyVdrPoolConfigV1 { + return v.value +} + +func (v *NullableAriesIndyVdrPoolConfigV1) Set(val *AriesIndyVdrPoolConfigV1) { + v.value = val + v.isSet = true +} + +func (v NullableAriesIndyVdrPoolConfigV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAriesIndyVdrPoolConfigV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAriesIndyVdrPoolConfigV1(val *AriesIndyVdrPoolConfigV1) *NullableAriesIndyVdrPoolConfigV1 { + return &NullableAriesIndyVdrPoolConfigV1{value: val, isSet: true} +} + +func (v NullableAriesIndyVdrPoolConfigV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAriesIndyVdrPoolConfigV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_proof_exchange_record_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_proof_exchange_record_v1.go new file mode 100644 index 00000000000..34497ca138f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_aries_proof_exchange_record_v1.go @@ -0,0 +1,337 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the AriesProofExchangeRecordV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AriesProofExchangeRecordV1{} + +// AriesProofExchangeRecordV1 Proof exchange record from Aries framework (simplified) +type AriesProofExchangeRecordV1 struct { + Id string `json:"id"` + ConnectionId *string `json:"connectionId,omitempty"` + ThreadId string `json:"threadId"` + State string `json:"state"` + ProtocolVersion string `json:"protocolVersion"` + IsVerified *bool `json:"isVerified,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AriesProofExchangeRecordV1 AriesProofExchangeRecordV1 + +// NewAriesProofExchangeRecordV1 instantiates a new AriesProofExchangeRecordV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAriesProofExchangeRecordV1(id string, threadId string, state string, protocolVersion string) *AriesProofExchangeRecordV1 { + this := AriesProofExchangeRecordV1{} + this.Id = id + this.ThreadId = threadId + this.State = state + this.ProtocolVersion = protocolVersion + return &this +} + +// NewAriesProofExchangeRecordV1WithDefaults instantiates a new AriesProofExchangeRecordV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAriesProofExchangeRecordV1WithDefaults() *AriesProofExchangeRecordV1 { + this := AriesProofExchangeRecordV1{} + return &this +} + +// GetId returns the Id field value +func (o *AriesProofExchangeRecordV1) 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 *AriesProofExchangeRecordV1) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *AriesProofExchangeRecordV1) SetId(v string) { + o.Id = v +} + +// GetConnectionId returns the ConnectionId field value if set, zero value otherwise. +func (o *AriesProofExchangeRecordV1) GetConnectionId() string { + if o == nil || IsNil(o.ConnectionId) { + var ret string + return ret + } + return *o.ConnectionId +} + +// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesProofExchangeRecordV1) GetConnectionIdOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionId) { + return nil, false + } + return o.ConnectionId, true +} + +// HasConnectionId returns a boolean if a field has been set. +func (o *AriesProofExchangeRecordV1) HasConnectionId() bool { + if o != nil && !IsNil(o.ConnectionId) { + return true + } + + return false +} + +// SetConnectionId gets a reference to the given string and assigns it to the ConnectionId field. +func (o *AriesProofExchangeRecordV1) SetConnectionId(v string) { + o.ConnectionId = &v +} + +// GetThreadId returns the ThreadId field value +func (o *AriesProofExchangeRecordV1) GetThreadId() string { + if o == nil { + var ret string + return ret + } + + return o.ThreadId +} + +// GetThreadIdOk returns a tuple with the ThreadId field value +// and a boolean to check if the value has been set. +func (o *AriesProofExchangeRecordV1) GetThreadIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ThreadId, true +} + +// SetThreadId sets field value +func (o *AriesProofExchangeRecordV1) SetThreadId(v string) { + o.ThreadId = v +} + +// GetState returns the State field value +func (o *AriesProofExchangeRecordV1) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *AriesProofExchangeRecordV1) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *AriesProofExchangeRecordV1) SetState(v string) { + o.State = v +} + +// GetProtocolVersion returns the ProtocolVersion field value +func (o *AriesProofExchangeRecordV1) GetProtocolVersion() string { + if o == nil { + var ret string + return ret + } + + return o.ProtocolVersion +} + +// GetProtocolVersionOk returns a tuple with the ProtocolVersion field value +// and a boolean to check if the value has been set. +func (o *AriesProofExchangeRecordV1) GetProtocolVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProtocolVersion, true +} + +// SetProtocolVersion sets field value +func (o *AriesProofExchangeRecordV1) SetProtocolVersion(v string) { + o.ProtocolVersion = v +} + +// GetIsVerified returns the IsVerified field value if set, zero value otherwise. +func (o *AriesProofExchangeRecordV1) GetIsVerified() bool { + if o == nil || IsNil(o.IsVerified) { + var ret bool + return ret + } + return *o.IsVerified +} + +// GetIsVerifiedOk returns a tuple with the IsVerified field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesProofExchangeRecordV1) GetIsVerifiedOk() (*bool, bool) { + if o == nil || IsNil(o.IsVerified) { + return nil, false + } + return o.IsVerified, true +} + +// HasIsVerified returns a boolean if a field has been set. +func (o *AriesProofExchangeRecordV1) HasIsVerified() bool { + if o != nil && !IsNil(o.IsVerified) { + return true + } + + return false +} + +// SetIsVerified gets a reference to the given bool and assigns it to the IsVerified field. +func (o *AriesProofExchangeRecordV1) SetIsVerified(v bool) { + o.IsVerified = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *AriesProofExchangeRecordV1) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AriesProofExchangeRecordV1) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *AriesProofExchangeRecordV1) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *AriesProofExchangeRecordV1) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +func (o AriesProofExchangeRecordV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AriesProofExchangeRecordV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.ConnectionId) { + toSerialize["connectionId"] = o.ConnectionId + } + toSerialize["threadId"] = o.ThreadId + toSerialize["state"] = o.State + toSerialize["protocolVersion"] = o.ProtocolVersion + if !IsNil(o.IsVerified) { + toSerialize["isVerified"] = o.IsVerified + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AriesProofExchangeRecordV1) UnmarshalJSON(bytes []byte) (err error) { + varAriesProofExchangeRecordV1 := _AriesProofExchangeRecordV1{} + + if err = json.Unmarshal(bytes, &varAriesProofExchangeRecordV1); err == nil { + *o = AriesProofExchangeRecordV1(varAriesProofExchangeRecordV1) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "connectionId") + delete(additionalProperties, "threadId") + delete(additionalProperties, "state") + delete(additionalProperties, "protocolVersion") + delete(additionalProperties, "isVerified") + delete(additionalProperties, "errorMessage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAriesProofExchangeRecordV1 struct { + value *AriesProofExchangeRecordV1 + isSet bool +} + +func (v NullableAriesProofExchangeRecordV1) Get() *AriesProofExchangeRecordV1 { + return v.value +} + +func (v *NullableAriesProofExchangeRecordV1) Set(val *AriesProofExchangeRecordV1) { + v.value = val + v.isSet = true +} + +func (v NullableAriesProofExchangeRecordV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAriesProofExchangeRecordV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAriesProofExchangeRecordV1(val *AriesProofExchangeRecordV1) *NullableAriesProofExchangeRecordV1 { + return &NullableAriesProofExchangeRecordV1{value: val, isSet: true} +} + +func (v NullableAriesProofExchangeRecordV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAriesProofExchangeRecordV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_accept_policy_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_accept_policy_v1.go new file mode 100644 index 00000000000..76ebb97af0d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_accept_policy_v1.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" + "fmt" +) + +// CactiAcceptPolicyV1 Credential / Proof requests acceptance policies for Aries agent +type CactiAcceptPolicyV1 string + +// List of CactiAcceptPolicyV1 +const ( + Always CactiAcceptPolicyV1 = "always" + ContentApproved CactiAcceptPolicyV1 = "contentApproved" + Never CactiAcceptPolicyV1 = "never" +) + +// All allowed values of CactiAcceptPolicyV1 enum +var AllowedCactiAcceptPolicyV1EnumValues = []CactiAcceptPolicyV1{ + "always", + "contentApproved", + "never", +} + +func (v *CactiAcceptPolicyV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CactiAcceptPolicyV1(value) + for _, existing := range AllowedCactiAcceptPolicyV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CactiAcceptPolicyV1", value) +} + +// NewCactiAcceptPolicyV1FromValue returns a pointer to a valid CactiAcceptPolicyV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCactiAcceptPolicyV1FromValue(v string) (*CactiAcceptPolicyV1, error) { + ev := CactiAcceptPolicyV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CactiAcceptPolicyV1: valid values are %v", v, AllowedCactiAcceptPolicyV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CactiAcceptPolicyV1) IsValid() bool { + for _, existing := range AllowedCactiAcceptPolicyV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CactiAcceptPolicyV1 value +func (v CactiAcceptPolicyV1) Ptr() *CactiAcceptPolicyV1 { + return &v +} + +type NullableCactiAcceptPolicyV1 struct { + value *CactiAcceptPolicyV1 + isSet bool +} + +func (v NullableCactiAcceptPolicyV1) Get() *CactiAcceptPolicyV1 { + return v.value +} + +func (v *NullableCactiAcceptPolicyV1) Set(val *CactiAcceptPolicyV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiAcceptPolicyV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiAcceptPolicyV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiAcceptPolicyV1(val *CactiAcceptPolicyV1) *NullableCactiAcceptPolicyV1 { + return &NullableCactiAcceptPolicyV1{value: val, isSet: true} +} + +func (v NullableCactiAcceptPolicyV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiAcceptPolicyV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_proof_request_attribute_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_proof_request_attribute_v1.go new file mode 100644 index 00000000000..aced490c487 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_cacti_proof_request_attribute_v1.go @@ -0,0 +1,194 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the CactiProofRequestAttributeV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiProofRequestAttributeV1{} + +// CactiProofRequestAttributeV1 Credential attribute checks to be performed by a proof request. +type CactiProofRequestAttributeV1 struct { + // Attribute name. + Name string `json:"name"` + // Check if attribute has specified value + IsValueEqual interface{} `json:"isValueEqual,omitempty"` + // Check if credentialDefinitionId has specified value + IsCredentialDefinitionIdEqual interface{} `json:"isCredentialDefinitionIdEqual,omitempty"` +} + +// NewCactiProofRequestAttributeV1 instantiates a new CactiProofRequestAttributeV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactiProofRequestAttributeV1(name string) *CactiProofRequestAttributeV1 { + this := CactiProofRequestAttributeV1{} + this.Name = name + return &this +} + +// NewCactiProofRequestAttributeV1WithDefaults instantiates a new CactiProofRequestAttributeV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiProofRequestAttributeV1WithDefaults() *CactiProofRequestAttributeV1 { + this := CactiProofRequestAttributeV1{} + return &this +} + +// GetName returns the Name field value +func (o *CactiProofRequestAttributeV1) 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 *CactiProofRequestAttributeV1) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CactiProofRequestAttributeV1) SetName(v string) { + o.Name = v +} + +// GetIsValueEqual returns the IsValueEqual field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CactiProofRequestAttributeV1) GetIsValueEqual() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.IsValueEqual +} + +// GetIsValueEqualOk returns a tuple with the IsValueEqual 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 *CactiProofRequestAttributeV1) GetIsValueEqualOk() (*interface{}, bool) { + if o == nil || IsNil(o.IsValueEqual) { + return nil, false + } + return &o.IsValueEqual, true +} + +// HasIsValueEqual returns a boolean if a field has been set. +func (o *CactiProofRequestAttributeV1) HasIsValueEqual() bool { + if o != nil && IsNil(o.IsValueEqual) { + return true + } + + return false +} + +// SetIsValueEqual gets a reference to the given interface{} and assigns it to the IsValueEqual field. +func (o *CactiProofRequestAttributeV1) SetIsValueEqual(v interface{}) { + o.IsValueEqual = v +} + +// GetIsCredentialDefinitionIdEqual returns the IsCredentialDefinitionIdEqual field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CactiProofRequestAttributeV1) GetIsCredentialDefinitionIdEqual() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.IsCredentialDefinitionIdEqual +} + +// GetIsCredentialDefinitionIdEqualOk returns a tuple with the IsCredentialDefinitionIdEqual 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 *CactiProofRequestAttributeV1) GetIsCredentialDefinitionIdEqualOk() (*interface{}, bool) { + if o == nil || IsNil(o.IsCredentialDefinitionIdEqual) { + return nil, false + } + return &o.IsCredentialDefinitionIdEqual, true +} + +// HasIsCredentialDefinitionIdEqual returns a boolean if a field has been set. +func (o *CactiProofRequestAttributeV1) HasIsCredentialDefinitionIdEqual() bool { + if o != nil && IsNil(o.IsCredentialDefinitionIdEqual) { + return true + } + + return false +} + +// SetIsCredentialDefinitionIdEqual gets a reference to the given interface{} and assigns it to the IsCredentialDefinitionIdEqual field. +func (o *CactiProofRequestAttributeV1) SetIsCredentialDefinitionIdEqual(v interface{}) { + o.IsCredentialDefinitionIdEqual = v +} + +func (o CactiProofRequestAttributeV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiProofRequestAttributeV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.IsValueEqual != nil { + toSerialize["isValueEqual"] = o.IsValueEqual + } + if o.IsCredentialDefinitionIdEqual != nil { + toSerialize["isCredentialDefinitionIdEqual"] = o.IsCredentialDefinitionIdEqual + } + return toSerialize, nil +} + +type NullableCactiProofRequestAttributeV1 struct { + value *CactiProofRequestAttributeV1 + isSet bool +} + +func (v NullableCactiProofRequestAttributeV1) Get() *CactiProofRequestAttributeV1 { + return v.value +} + +func (v *NullableCactiProofRequestAttributeV1) Set(val *CactiProofRequestAttributeV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiProofRequestAttributeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiProofRequestAttributeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiProofRequestAttributeV1(val *CactiProofRequestAttributeV1) *NullableCactiProofRequestAttributeV1 { + return &NullableCactiProofRequestAttributeV1{value: val, isSet: true} +} + +func (v NullableCactiProofRequestAttributeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiProofRequestAttributeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_request.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_request.go new file mode 100644 index 00000000000..5133834e798 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_request.go @@ -0,0 +1,155 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the CreateNewConnectionInvitationV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNewConnectionInvitationV1Request{} + +// CreateNewConnectionInvitationV1Request Request for CreateNewConnectionInvitation endpoint. +type CreateNewConnectionInvitationV1Request struct { + // Aries label of an agent to use to generate an invitation + AgentName string `json:"agentName"` + // Invitation URL domain to use. If not specified, then connector default domain will be used + InvitationDomain *string `json:"invitationDomain,omitempty"` +} + +// NewCreateNewConnectionInvitationV1Request instantiates a new CreateNewConnectionInvitationV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNewConnectionInvitationV1Request(agentName string) *CreateNewConnectionInvitationV1Request { + this := CreateNewConnectionInvitationV1Request{} + this.AgentName = agentName + return &this +} + +// NewCreateNewConnectionInvitationV1RequestWithDefaults instantiates a new CreateNewConnectionInvitationV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNewConnectionInvitationV1RequestWithDefaults() *CreateNewConnectionInvitationV1Request { + this := CreateNewConnectionInvitationV1Request{} + return &this +} + +// GetAgentName returns the AgentName field value +func (o *CreateNewConnectionInvitationV1Request) GetAgentName() string { + if o == nil { + var ret string + return ret + } + + return o.AgentName +} + +// GetAgentNameOk returns a tuple with the AgentName field value +// and a boolean to check if the value has been set. +func (o *CreateNewConnectionInvitationV1Request) GetAgentNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentName, true +} + +// SetAgentName sets field value +func (o *CreateNewConnectionInvitationV1Request) SetAgentName(v string) { + o.AgentName = v +} + +// GetInvitationDomain returns the InvitationDomain field value if set, zero value otherwise. +func (o *CreateNewConnectionInvitationV1Request) GetInvitationDomain() string { + if o == nil || IsNil(o.InvitationDomain) { + var ret string + return ret + } + return *o.InvitationDomain +} + +// GetInvitationDomainOk returns a tuple with the InvitationDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNewConnectionInvitationV1Request) GetInvitationDomainOk() (*string, bool) { + if o == nil || IsNil(o.InvitationDomain) { + return nil, false + } + return o.InvitationDomain, true +} + +// HasInvitationDomain returns a boolean if a field has been set. +func (o *CreateNewConnectionInvitationV1Request) HasInvitationDomain() bool { + if o != nil && !IsNil(o.InvitationDomain) { + return true + } + + return false +} + +// SetInvitationDomain gets a reference to the given string and assigns it to the InvitationDomain field. +func (o *CreateNewConnectionInvitationV1Request) SetInvitationDomain(v string) { + o.InvitationDomain = &v +} + +func (o CreateNewConnectionInvitationV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNewConnectionInvitationV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["agentName"] = o.AgentName + if !IsNil(o.InvitationDomain) { + toSerialize["invitationDomain"] = o.InvitationDomain + } + return toSerialize, nil +} + +type NullableCreateNewConnectionInvitationV1Request struct { + value *CreateNewConnectionInvitationV1Request + isSet bool +} + +func (v NullableCreateNewConnectionInvitationV1Request) Get() *CreateNewConnectionInvitationV1Request { + return v.value +} + +func (v *NullableCreateNewConnectionInvitationV1Request) Set(val *CreateNewConnectionInvitationV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNewConnectionInvitationV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNewConnectionInvitationV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNewConnectionInvitationV1Request(val *CreateNewConnectionInvitationV1Request) *NullableCreateNewConnectionInvitationV1Request { + return &NullableCreateNewConnectionInvitationV1Request{value: val, isSet: true} +} + +func (v NullableCreateNewConnectionInvitationV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNewConnectionInvitationV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_response.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_response.go new file mode 100644 index 00000000000..7ade9187f78 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_create_new_connection_invitation_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the CreateNewConnectionInvitationV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNewConnectionInvitationV1Response{} + +// CreateNewConnectionInvitationV1Response Response for CreateNewConnectionInvitation endpoint. +type CreateNewConnectionInvitationV1Response struct { + // Invitation URL that can be used by another aries agent to connect to us. + InvitationUrl string `json:"invitationUrl"` + // ID that can be used to track status of the connection + OutOfBandId string `json:"outOfBandId"` +} + +// NewCreateNewConnectionInvitationV1Response instantiates a new CreateNewConnectionInvitationV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNewConnectionInvitationV1Response(invitationUrl string, outOfBandId string) *CreateNewConnectionInvitationV1Response { + this := CreateNewConnectionInvitationV1Response{} + this.InvitationUrl = invitationUrl + this.OutOfBandId = outOfBandId + return &this +} + +// NewCreateNewConnectionInvitationV1ResponseWithDefaults instantiates a new CreateNewConnectionInvitationV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNewConnectionInvitationV1ResponseWithDefaults() *CreateNewConnectionInvitationV1Response { + this := CreateNewConnectionInvitationV1Response{} + return &this +} + +// GetInvitationUrl returns the InvitationUrl field value +func (o *CreateNewConnectionInvitationV1Response) GetInvitationUrl() string { + if o == nil { + var ret string + return ret + } + + return o.InvitationUrl +} + +// GetInvitationUrlOk returns a tuple with the InvitationUrl field value +// and a boolean to check if the value has been set. +func (o *CreateNewConnectionInvitationV1Response) GetInvitationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvitationUrl, true +} + +// SetInvitationUrl sets field value +func (o *CreateNewConnectionInvitationV1Response) SetInvitationUrl(v string) { + o.InvitationUrl = v +} + +// GetOutOfBandId returns the OutOfBandId field value +func (o *CreateNewConnectionInvitationV1Response) GetOutOfBandId() string { + if o == nil { + var ret string + return ret + } + + return o.OutOfBandId +} + +// GetOutOfBandIdOk returns a tuple with the OutOfBandId field value +// and a boolean to check if the value has been set. +func (o *CreateNewConnectionInvitationV1Response) GetOutOfBandIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OutOfBandId, true +} + +// SetOutOfBandId sets field value +func (o *CreateNewConnectionInvitationV1Response) SetOutOfBandId(v string) { + o.OutOfBandId = v +} + +func (o CreateNewConnectionInvitationV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNewConnectionInvitationV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["invitationUrl"] = o.InvitationUrl + toSerialize["outOfBandId"] = o.OutOfBandId + return toSerialize, nil +} + +type NullableCreateNewConnectionInvitationV1Response struct { + value *CreateNewConnectionInvitationV1Response + isSet bool +} + +func (v NullableCreateNewConnectionInvitationV1Response) Get() *CreateNewConnectionInvitationV1Response { + return v.value +} + +func (v *NullableCreateNewConnectionInvitationV1Response) Set(val *CreateNewConnectionInvitationV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNewConnectionInvitationV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNewConnectionInvitationV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNewConnectionInvitationV1Response(val *CreateNewConnectionInvitationV1Response) *NullableCreateNewConnectionInvitationV1Response { + return &NullableCreateNewConnectionInvitationV1Response{value: val, isSet: true} +} + +func (v NullableCreateNewConnectionInvitationV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNewConnectionInvitationV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_error_exception_v1_response.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_error_exception_v1_response.go new file mode 100644 index 00000000000..cdcecc210ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_error_exception_v1_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionV1Response{} + +// ErrorExceptionV1Response Error response from the connector. +type ErrorExceptionV1Response struct { + // Short error description message. + Message string `json:"message"` + // Detailed error information. + Error string `json:"error"` +} + +// NewErrorExceptionV1Response instantiates a new ErrorExceptionV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionV1Response(message string, error_ string) *ErrorExceptionV1Response { + this := ErrorExceptionV1Response{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionV1ResponseWithDefaults instantiates a new ErrorExceptionV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionV1ResponseWithDefaults() *ErrorExceptionV1Response { + this := ErrorExceptionV1Response{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionV1Response) 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 *ErrorExceptionV1Response) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionV1Response) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionV1Response) 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 *ErrorExceptionV1Response) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionV1Response) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionV1Response struct { + value *ErrorExceptionV1Response + isSet bool +} + +func (v NullableErrorExceptionV1Response) Get() *ErrorExceptionV1Response { + return v.value +} + +func (v *NullableErrorExceptionV1Response) Set(val *ErrorExceptionV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionV1Response(val *ErrorExceptionV1Response) *NullableErrorExceptionV1Response { + return &NullableErrorExceptionV1Response{value: val, isSet: true} +} + +func (v NullableErrorExceptionV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_get_connections_v1_request.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_get_connections_v1_request.go new file mode 100644 index 00000000000..7fe7518a49f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_get_connections_v1_request.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the GetConnectionsV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetConnectionsV1Request{} + +// GetConnectionsV1Request Request for GetConnections endpoint. +type GetConnectionsV1Request struct { + AgentName string `json:"agentName"` + Filter *AgentConnectionsFilterV1 `json:"filter,omitempty"` +} + +// NewGetConnectionsV1Request instantiates a new GetConnectionsV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetConnectionsV1Request(agentName string) *GetConnectionsV1Request { + this := GetConnectionsV1Request{} + this.AgentName = agentName + return &this +} + +// NewGetConnectionsV1RequestWithDefaults instantiates a new GetConnectionsV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetConnectionsV1RequestWithDefaults() *GetConnectionsV1Request { + this := GetConnectionsV1Request{} + return &this +} + +// GetAgentName returns the AgentName field value +func (o *GetConnectionsV1Request) GetAgentName() string { + if o == nil { + var ret string + return ret + } + + return o.AgentName +} + +// GetAgentNameOk returns a tuple with the AgentName field value +// and a boolean to check if the value has been set. +func (o *GetConnectionsV1Request) GetAgentNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentName, true +} + +// SetAgentName sets field value +func (o *GetConnectionsV1Request) SetAgentName(v string) { + o.AgentName = v +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *GetConnectionsV1Request) GetFilter() AgentConnectionsFilterV1 { + if o == nil || IsNil(o.Filter) { + var ret AgentConnectionsFilterV1 + 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 *GetConnectionsV1Request) GetFilterOk() (*AgentConnectionsFilterV1, 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 *GetConnectionsV1Request) HasFilter() bool { + if o != nil && !IsNil(o.Filter) { + return true + } + + return false +} + +// SetFilter gets a reference to the given AgentConnectionsFilterV1 and assigns it to the Filter field. +func (o *GetConnectionsV1Request) SetFilter(v AgentConnectionsFilterV1) { + o.Filter = &v +} + +func (o GetConnectionsV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetConnectionsV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["agentName"] = o.AgentName + if !IsNil(o.Filter) { + toSerialize["filter"] = o.Filter + } + return toSerialize, nil +} + +type NullableGetConnectionsV1Request struct { + value *GetConnectionsV1Request + isSet bool +} + +func (v NullableGetConnectionsV1Request) Get() *GetConnectionsV1Request { + return v.value +} + +func (v *NullableGetConnectionsV1Request) Set(val *GetConnectionsV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableGetConnectionsV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableGetConnectionsV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetConnectionsV1Request(val *GetConnectionsV1Request) *NullableGetConnectionsV1Request { + return &NullableGetConnectionsV1Request{value: val, isSet: true} +} + +func (v NullableGetConnectionsV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetConnectionsV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_request_proof_v1_request.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_request_proof_v1_request.go new file mode 100644 index 00000000000..3c2d37fb20f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_request_proof_v1_request.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the RequestProofV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestProofV1Request{} + +// RequestProofV1Request Request for RequestProof endpoint. +type RequestProofV1Request struct { + // Aries label of an agent to be used to connect using URL + AgentName string `json:"agentName"` + // Peer connection ID from which we want to request a proof. + ConnectionId string `json:"connectionId"` + ProofAttributes []CactiProofRequestAttributeV1 `json:"proofAttributes"` +} + +// NewRequestProofV1Request instantiates a new RequestProofV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestProofV1Request(agentName string, connectionId string, proofAttributes []CactiProofRequestAttributeV1) *RequestProofV1Request { + this := RequestProofV1Request{} + this.AgentName = agentName + this.ConnectionId = connectionId + this.ProofAttributes = proofAttributes + return &this +} + +// NewRequestProofV1RequestWithDefaults instantiates a new RequestProofV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestProofV1RequestWithDefaults() *RequestProofV1Request { + this := RequestProofV1Request{} + return &this +} + +// GetAgentName returns the AgentName field value +func (o *RequestProofV1Request) GetAgentName() string { + if o == nil { + var ret string + return ret + } + + return o.AgentName +} + +// GetAgentNameOk returns a tuple with the AgentName field value +// and a boolean to check if the value has been set. +func (o *RequestProofV1Request) GetAgentNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentName, true +} + +// SetAgentName sets field value +func (o *RequestProofV1Request) SetAgentName(v string) { + o.AgentName = v +} + +// GetConnectionId returns the ConnectionId field value +func (o *RequestProofV1Request) GetConnectionId() string { + if o == nil { + var ret string + return ret + } + + return o.ConnectionId +} + +// GetConnectionIdOk returns a tuple with the ConnectionId field value +// and a boolean to check if the value has been set. +func (o *RequestProofV1Request) GetConnectionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConnectionId, true +} + +// SetConnectionId sets field value +func (o *RequestProofV1Request) SetConnectionId(v string) { + o.ConnectionId = v +} + +// GetProofAttributes returns the ProofAttributes field value +func (o *RequestProofV1Request) GetProofAttributes() []CactiProofRequestAttributeV1 { + if o == nil { + var ret []CactiProofRequestAttributeV1 + return ret + } + + return o.ProofAttributes +} + +// GetProofAttributesOk returns a tuple with the ProofAttributes field value +// and a boolean to check if the value has been set. +func (o *RequestProofV1Request) GetProofAttributesOk() ([]CactiProofRequestAttributeV1, bool) { + if o == nil { + return nil, false + } + return o.ProofAttributes, true +} + +// SetProofAttributes sets field value +func (o *RequestProofV1Request) SetProofAttributes(v []CactiProofRequestAttributeV1) { + o.ProofAttributes = v +} + +func (o RequestProofV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestProofV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["agentName"] = o.AgentName + toSerialize["connectionId"] = o.ConnectionId + toSerialize["proofAttributes"] = o.ProofAttributes + return toSerialize, nil +} + +type NullableRequestProofV1Request struct { + value *RequestProofV1Request + isSet bool +} + +func (v NullableRequestProofV1Request) Get() *RequestProofV1Request { + return v.value +} + +func (v *NullableRequestProofV1Request) Set(val *RequestProofV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableRequestProofV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestProofV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestProofV1Request(val *RequestProofV1Request) *NullableRequestProofV1Request { + return &NullableRequestProofV1Request{value: val, isSet: true} +} + +func (v NullableRequestProofV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestProofV1Request) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_options_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_options_v1.go new file mode 100644 index 00000000000..e9d358a2e45 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_options_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the WatchConnectionStateOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchConnectionStateOptionsV1{} + +// WatchConnectionStateOptionsV1 Options passed when monitoring connection change events. +type WatchConnectionStateOptionsV1 struct { + // Aries agent label that will also be used as wallet id. + AgentName string `json:"agentName"` +} + +// NewWatchConnectionStateOptionsV1 instantiates a new WatchConnectionStateOptionsV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchConnectionStateOptionsV1(agentName string) *WatchConnectionStateOptionsV1 { + this := WatchConnectionStateOptionsV1{} + this.AgentName = agentName + return &this +} + +// NewWatchConnectionStateOptionsV1WithDefaults instantiates a new WatchConnectionStateOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchConnectionStateOptionsV1WithDefaults() *WatchConnectionStateOptionsV1 { + this := WatchConnectionStateOptionsV1{} + return &this +} + +// GetAgentName returns the AgentName field value +func (o *WatchConnectionStateOptionsV1) GetAgentName() string { + if o == nil { + var ret string + return ret + } + + return o.AgentName +} + +// GetAgentNameOk returns a tuple with the AgentName field value +// and a boolean to check if the value has been set. +func (o *WatchConnectionStateOptionsV1) GetAgentNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentName, true +} + +// SetAgentName sets field value +func (o *WatchConnectionStateOptionsV1) SetAgentName(v string) { + o.AgentName = v +} + +func (o WatchConnectionStateOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchConnectionStateOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["agentName"] = o.AgentName + return toSerialize, nil +} + +type NullableWatchConnectionStateOptionsV1 struct { + value *WatchConnectionStateOptionsV1 + isSet bool +} + +func (v NullableWatchConnectionStateOptionsV1) Get() *WatchConnectionStateOptionsV1 { + return v.value +} + +func (v *NullableWatchConnectionStateOptionsV1) Set(val *WatchConnectionStateOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchConnectionStateOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchConnectionStateOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchConnectionStateOptionsV1(val *WatchConnectionStateOptionsV1) *NullableWatchConnectionStateOptionsV1 { + return &NullableWatchConnectionStateOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchConnectionStateOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchConnectionStateOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_progress_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_progress_v1.go new file mode 100644 index 00000000000..f82918aa8f5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_progress_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the WatchConnectionStateProgressV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchConnectionStateProgressV1{} + +// WatchConnectionStateProgressV1 Values pushed on each connection state change. +type WatchConnectionStateProgressV1 struct { + ConnectionRecord AgentConnectionRecordV1 `json:"connectionRecord"` + PreviousState NullableString `json:"previousState"` +} + +// NewWatchConnectionStateProgressV1 instantiates a new WatchConnectionStateProgressV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchConnectionStateProgressV1(connectionRecord AgentConnectionRecordV1, previousState NullableString) *WatchConnectionStateProgressV1 { + this := WatchConnectionStateProgressV1{} + this.ConnectionRecord = connectionRecord + this.PreviousState = previousState + return &this +} + +// NewWatchConnectionStateProgressV1WithDefaults instantiates a new WatchConnectionStateProgressV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchConnectionStateProgressV1WithDefaults() *WatchConnectionStateProgressV1 { + this := WatchConnectionStateProgressV1{} + return &this +} + +// GetConnectionRecord returns the ConnectionRecord field value +func (o *WatchConnectionStateProgressV1) GetConnectionRecord() AgentConnectionRecordV1 { + if o == nil { + var ret AgentConnectionRecordV1 + return ret + } + + return o.ConnectionRecord +} + +// GetConnectionRecordOk returns a tuple with the ConnectionRecord field value +// and a boolean to check if the value has been set. +func (o *WatchConnectionStateProgressV1) GetConnectionRecordOk() (*AgentConnectionRecordV1, bool) { + if o == nil { + return nil, false + } + return &o.ConnectionRecord, true +} + +// SetConnectionRecord sets field value +func (o *WatchConnectionStateProgressV1) SetConnectionRecord(v AgentConnectionRecordV1) { + o.ConnectionRecord = v +} + +// GetPreviousState returns the PreviousState field value +// If the value is explicit nil, the zero value for string will be returned +func (o *WatchConnectionStateProgressV1) GetPreviousState() string { + if o == nil || o.PreviousState.Get() == nil { + var ret string + return ret + } + + return *o.PreviousState.Get() +} + +// GetPreviousStateOk returns a tuple with the PreviousState 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 *WatchConnectionStateProgressV1) GetPreviousStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PreviousState.Get(), o.PreviousState.IsSet() +} + +// SetPreviousState sets field value +func (o *WatchConnectionStateProgressV1) SetPreviousState(v string) { + o.PreviousState.Set(&v) +} + +func (o WatchConnectionStateProgressV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchConnectionStateProgressV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["connectionRecord"] = o.ConnectionRecord + toSerialize["previousState"] = o.PreviousState.Get() + return toSerialize, nil +} + +type NullableWatchConnectionStateProgressV1 struct { + value *WatchConnectionStateProgressV1 + isSet bool +} + +func (v NullableWatchConnectionStateProgressV1) Get() *WatchConnectionStateProgressV1 { + return v.value +} + +func (v *NullableWatchConnectionStateProgressV1) Set(val *WatchConnectionStateProgressV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchConnectionStateProgressV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchConnectionStateProgressV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchConnectionStateProgressV1(val *WatchConnectionStateProgressV1) *NullableWatchConnectionStateProgressV1 { + return &NullableWatchConnectionStateProgressV1{value: val, isSet: true} +} + +func (v NullableWatchConnectionStateProgressV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchConnectionStateProgressV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_v1.go new file mode 100644 index 00000000000..39c77463f39 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_connection_state_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" + "fmt" +) + +// WatchConnectionStateV1 Websocket requests for monitoring connection change events. +type WatchConnectionStateV1 string + +// List of WatchConnectionStateV1 +const ( + Subscribe WatchConnectionStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Subscribe" + Next WatchConnectionStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Next" + Unsubscribe WatchConnectionStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Unsubscribe" + Error WatchConnectionStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Error" + Complete WatchConnectionStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Complete" +) + +// All allowed values of WatchConnectionStateV1 enum +var AllowedWatchConnectionStateV1EnumValues = []WatchConnectionStateV1{ + "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Subscribe", + "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Next", + "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Unsubscribe", + "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Error", + "org.hyperledger.cactus.api.async.hlaries.WatchConnectionStateV1.Complete", +} + +func (v *WatchConnectionStateV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchConnectionStateV1(value) + for _, existing := range AllowedWatchConnectionStateV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchConnectionStateV1", value) +} + +// NewWatchConnectionStateV1FromValue returns a pointer to a valid WatchConnectionStateV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchConnectionStateV1FromValue(v string) (*WatchConnectionStateV1, error) { + ev := WatchConnectionStateV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchConnectionStateV1: valid values are %v", v, AllowedWatchConnectionStateV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchConnectionStateV1) IsValid() bool { + for _, existing := range AllowedWatchConnectionStateV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchConnectionStateV1 value +func (v WatchConnectionStateV1) Ptr() *WatchConnectionStateV1 { + return &v +} + +type NullableWatchConnectionStateV1 struct { + value *WatchConnectionStateV1 + isSet bool +} + +func (v NullableWatchConnectionStateV1) Get() *WatchConnectionStateV1 { + return v.value +} + +func (v *NullableWatchConnectionStateV1) Set(val *WatchConnectionStateV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchConnectionStateV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchConnectionStateV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchConnectionStateV1(val *WatchConnectionStateV1) *NullableWatchConnectionStateV1 { + return &NullableWatchConnectionStateV1{value: val, isSet: true} +} + +func (v NullableWatchConnectionStateV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchConnectionStateV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_options_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_options_v1.go new file mode 100644 index 00000000000..eeb613e9abe --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_options_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the WatchProofStateOptionsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchProofStateOptionsV1{} + +// WatchProofStateOptionsV1 Options passed when monitoring proof state change events. +type WatchProofStateOptionsV1 struct { + // Aries agent label that will also be used as wallet id. + AgentName string `json:"agentName"` +} + +// NewWatchProofStateOptionsV1 instantiates a new WatchProofStateOptionsV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchProofStateOptionsV1(agentName string) *WatchProofStateOptionsV1 { + this := WatchProofStateOptionsV1{} + this.AgentName = agentName + return &this +} + +// NewWatchProofStateOptionsV1WithDefaults instantiates a new WatchProofStateOptionsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchProofStateOptionsV1WithDefaults() *WatchProofStateOptionsV1 { + this := WatchProofStateOptionsV1{} + return &this +} + +// GetAgentName returns the AgentName field value +func (o *WatchProofStateOptionsV1) GetAgentName() string { + if o == nil { + var ret string + return ret + } + + return o.AgentName +} + +// GetAgentNameOk returns a tuple with the AgentName field value +// and a boolean to check if the value has been set. +func (o *WatchProofStateOptionsV1) GetAgentNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AgentName, true +} + +// SetAgentName sets field value +func (o *WatchProofStateOptionsV1) SetAgentName(v string) { + o.AgentName = v +} + +func (o WatchProofStateOptionsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchProofStateOptionsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["agentName"] = o.AgentName + return toSerialize, nil +} + +type NullableWatchProofStateOptionsV1 struct { + value *WatchProofStateOptionsV1 + isSet bool +} + +func (v NullableWatchProofStateOptionsV1) Get() *WatchProofStateOptionsV1 { + return v.value +} + +func (v *NullableWatchProofStateOptionsV1) Set(val *WatchProofStateOptionsV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchProofStateOptionsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchProofStateOptionsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchProofStateOptionsV1(val *WatchProofStateOptionsV1) *NullableWatchProofStateOptionsV1 { + return &NullableWatchProofStateOptionsV1{value: val, isSet: true} +} + +func (v NullableWatchProofStateOptionsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchProofStateOptionsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_progress_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_progress_v1.go new file mode 100644 index 00000000000..2ba9eee9462 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_progress_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" +) + +// checks if the WatchProofStateProgressV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchProofStateProgressV1{} + +// WatchProofStateProgressV1 Values pushed on each proof state change. +type WatchProofStateProgressV1 struct { + ProofRecord AriesProofExchangeRecordV1 `json:"proofRecord"` + PreviousState NullableString `json:"previousState"` +} + +// NewWatchProofStateProgressV1 instantiates a new WatchProofStateProgressV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchProofStateProgressV1(proofRecord AriesProofExchangeRecordV1, previousState NullableString) *WatchProofStateProgressV1 { + this := WatchProofStateProgressV1{} + this.ProofRecord = proofRecord + this.PreviousState = previousState + return &this +} + +// NewWatchProofStateProgressV1WithDefaults instantiates a new WatchProofStateProgressV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchProofStateProgressV1WithDefaults() *WatchProofStateProgressV1 { + this := WatchProofStateProgressV1{} + return &this +} + +// GetProofRecord returns the ProofRecord field value +func (o *WatchProofStateProgressV1) GetProofRecord() AriesProofExchangeRecordV1 { + if o == nil { + var ret AriesProofExchangeRecordV1 + return ret + } + + return o.ProofRecord +} + +// GetProofRecordOk returns a tuple with the ProofRecord field value +// and a boolean to check if the value has been set. +func (o *WatchProofStateProgressV1) GetProofRecordOk() (*AriesProofExchangeRecordV1, bool) { + if o == nil { + return nil, false + } + return &o.ProofRecord, true +} + +// SetProofRecord sets field value +func (o *WatchProofStateProgressV1) SetProofRecord(v AriesProofExchangeRecordV1) { + o.ProofRecord = v +} + +// GetPreviousState returns the PreviousState field value +// If the value is explicit nil, the zero value for string will be returned +func (o *WatchProofStateProgressV1) GetPreviousState() string { + if o == nil || o.PreviousState.Get() == nil { + var ret string + return ret + } + + return *o.PreviousState.Get() +} + +// GetPreviousStateOk returns a tuple with the PreviousState 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 *WatchProofStateProgressV1) GetPreviousStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PreviousState.Get(), o.PreviousState.IsSet() +} + +// SetPreviousState sets field value +func (o *WatchProofStateProgressV1) SetPreviousState(v string) { + o.PreviousState.Set(&v) +} + +func (o WatchProofStateProgressV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchProofStateProgressV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["proofRecord"] = o.ProofRecord + toSerialize["previousState"] = o.PreviousState.Get() + return toSerialize, nil +} + +type NullableWatchProofStateProgressV1 struct { + value *WatchProofStateProgressV1 + isSet bool +} + +func (v NullableWatchProofStateProgressV1) Get() *WatchProofStateProgressV1 { + return v.value +} + +func (v *NullableWatchProofStateProgressV1) Set(val *WatchProofStateProgressV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchProofStateProgressV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchProofStateProgressV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchProofStateProgressV1(val *WatchProofStateProgressV1) *NullableWatchProofStateProgressV1 { + return &NullableWatchProofStateProgressV1{value: val, isSet: true} +} + +func (v NullableWatchProofStateProgressV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchProofStateProgressV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_v1.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_v1.go new file mode 100644 index 00000000000..2256a131f52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/model_watch_proof_state_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +import ( + "encoding/json" + "fmt" +) + +// WatchProofStateV1 Websocket requests for monitoring proof state change events. +type WatchProofStateV1 string + +// List of WatchProofStateV1 +const ( + Subscribe WatchProofStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Subscribe" + Next WatchProofStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Next" + Unsubscribe WatchProofStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Unsubscribe" + Error WatchProofStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Error" + Complete WatchProofStateV1 = "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Complete" +) + +// All allowed values of WatchProofStateV1 enum +var AllowedWatchProofStateV1EnumValues = []WatchProofStateV1{ + "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Subscribe", + "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Next", + "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Unsubscribe", + "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Error", + "org.hyperledger.cactus.api.async.hlaries.WatchProofStateV1.Complete", +} + +func (v *WatchProofStateV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WatchProofStateV1(value) + for _, existing := range AllowedWatchProofStateV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WatchProofStateV1", value) +} + +// NewWatchProofStateV1FromValue returns a pointer to a valid WatchProofStateV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWatchProofStateV1FromValue(v string) (*WatchProofStateV1, error) { + ev := WatchProofStateV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WatchProofStateV1: valid values are %v", v, AllowedWatchProofStateV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WatchProofStateV1) IsValid() bool { + for _, existing := range AllowedWatchProofStateV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WatchProofStateV1 value +func (v WatchProofStateV1) Ptr() *WatchProofStateV1 { + return &v +} + +type NullableWatchProofStateV1 struct { + value *WatchProofStateV1 + isSet bool +} + +func (v NullableWatchProofStateV1) Get() *WatchProofStateV1 { + return v.value +} + +func (v *NullableWatchProofStateV1) Set(val *WatchProofStateV1) { + v.value = val + v.isSet = true +} + +func (v NullableWatchProofStateV1) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchProofStateV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchProofStateV1(val *WatchProofStateV1) *NullableWatchProofStateV1 { + return &NullableWatchProofStateV1{value: val, isSet: true} +} + +func (v NullableWatchProofStateV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchProofStateV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..947bc9fdaa1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +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-aries/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..427f8fdfd3a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,85 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-aries + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-aries_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService AcceptInvitationV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.AcceptInvitationV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService CreateNewConnectionInvitationV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.CreateNewConnectionInvitationV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetAgentsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetAgentsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetConnectionsV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetConnectionsV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RequestProofV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RequestProofV1(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-aries/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..3b04907797b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-aries/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cacti Plugin - Connector Aries + +Can communicate with other Aries agents and Cacti Aries connectors + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-aries + +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/package.json b/packages/cactus-plugin-ledger-connector-besu/package.json index 163914148e6..1e54e43be2d 100644 --- a/packages/cactus-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-plugin-ledger-connector-besu/package.json @@ -44,10 +44,11 @@ ], "scripts": { "benchmark": "tsx ./src/test/typescript/benchmark/run-plugin-ledger-connector-besu-benchmark.ts .tmp/benchmark-results/plugin-ledger-connector-besu/run-plugin-ledger-connector-besu-benchmark.ts.log", - "codegen": "run-s 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "codegen:proto": "run-s proto:openapi proto:protoc-gen-ts", "generate-sdk": "run-s 'generate-sdk:*'", + "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: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", "proto:openapi": "yarn run --top-level openapi-generator-cli generate -i ./src/main/json/openapi.json -g protobuf-schema --model-name-suffix=PB --language-specific-primitives=google.protobuf.Any --type-mappings=AnyType=google.protobuf.Any --type-mappings=object=google.protobuf.Any --additional-properties=packageName=org.hyperledger.cacti.plugin.ledger.connector.besu -o ./src/main/proto/generated/openapi/ -t=./src/main/mustache/openapi-generator/templates/protobuf-schema/ --ignore-file-override ../../openapi-generator-ignore", "proto:protoc-gen-ts": "yarn run --top-level 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/ --proto_path ./src/main/proto/generated/openapi/models/ --proto_path ./src/main/proto/ ./src/main/proto/generated/openapi/services/*.proto ./src/main/proto/services/*.proto", 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..5281a8735b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,53 @@ +.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_no_keychain_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_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_watch_blocks_v1_request.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 +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..d1003a4b0e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,165 @@ +# 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: 2.0.0-rc.3 +- 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* | [**DeployContractSolBytecodeNoKeychainV1**](docs/DefaultApi.md#deploycontractsolbytecodenokeychainv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain | Deploys the bytecode of a Solidity contract without the need of keychain +*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) + - [DeployContractSolidityBytecodeNoKeychainV1Request](docs/DeployContractSolidityBytecodeNoKeychainV1Request.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) + - [WatchBlocksV1Request](docs/WatchBlocksV1Request.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..afe9b7b9359 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1333 @@ +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: 2.0.0-rc.3 +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/deploy-contract-solidity-bytecode-no-keychain: + post: + operationId: deployContractSolBytecodeNoKeychainV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeNoKeychainV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractSolidityBytecodeV1Response' + description: OK + summary: Deploys the bytecode of a Solidity contract without the need of keychain + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/deploy-contract-solidity-bytecode-no-keychain + /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 + WatchBlocksV1Request: + properties: + event: + $ref: '#/components/schemas/WatchBlocksV1' + required: + - event + type: object + 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 + DeployContractSolidityBytecodeNoKeychainV1Request: + additionalProperties: false + example: + bytecode: bytecode + privateTransactionConfig: + privateFrom: privateFrom + privateFor: + - "" + - "" + constructorArgs: + - "" + - "" + timeoutMs: 0.6027456183070403 + contractAbi: + - "" + - "" + gas: 0.8008281904610115 + web3SigningCredential: + type: null + contractName: contractName + contractJSONString: contractJSONString + 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 + contractJSONString: + description: "For use when not using keychain, pass the contract in as this\ + \ string variable" + nullable: false + type: string + 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 + 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 + - contractJson + - 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..f2015a262d1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1272 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 ApiDeployContractSolBytecodeNoKeychainV1Request struct { + ctx context.Context + ApiService *DefaultApiService + deployContractSolidityBytecodeNoKeychainV1Request *DeployContractSolidityBytecodeNoKeychainV1Request +} + +func (r ApiDeployContractSolBytecodeNoKeychainV1Request) DeployContractSolidityBytecodeNoKeychainV1Request(deployContractSolidityBytecodeNoKeychainV1Request DeployContractSolidityBytecodeNoKeychainV1Request) ApiDeployContractSolBytecodeNoKeychainV1Request { + r.deployContractSolidityBytecodeNoKeychainV1Request = &deployContractSolidityBytecodeNoKeychainV1Request + return r +} + +func (r ApiDeployContractSolBytecodeNoKeychainV1Request) Execute() (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + return r.ApiService.DeployContractSolBytecodeNoKeychainV1Execute(r) +} + +/* +DeployContractSolBytecodeNoKeychainV1 Deploys the bytecode of a Solidity contract without the need of keychain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractSolBytecodeNoKeychainV1Request +*/ +func (a *DefaultApiService) DeployContractSolBytecodeNoKeychainV1(ctx context.Context) ApiDeployContractSolBytecodeNoKeychainV1Request { + return ApiDeployContractSolBytecodeNoKeychainV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractSolidityBytecodeV1Response +func (a *DefaultApiService) DeployContractSolBytecodeNoKeychainV1Execute(r ApiDeployContractSolBytecodeNoKeychainV1Request) (*DeployContractSolidityBytecodeV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractSolidityBytecodeV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractSolBytecodeNoKeychainV1") + 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-no-keychain" + + 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.deployContractSolidityBytecodeNoKeychainV1Request + 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-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..17452e0ef05 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..b0498605f6b --- /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: 2.0.0-rc.3 +*/ + +// 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..e94574eda35 --- /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: 2.0.0-rc.3 +*/ + +// 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..44f7dbdea6d --- /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: 2.0.0-rc.3 +*/ + +// 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..90d08bb5aeb --- /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: 2.0.0-rc.3 +*/ + +// 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..263e308dbab --- /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: 2.0.0-rc.3 +*/ + +// 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_no_keychain_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_no_keychain_v1_request.go new file mode 100644 index 00000000000..9ad578b1085 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_deploy_contract_solidity_bytecode_no_keychain_v1_request.go @@ -0,0 +1,414 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the DeployContractSolidityBytecodeNoKeychainV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractSolidityBytecodeNoKeychainV1Request{} + +// DeployContractSolidityBytecodeNoKeychainV1Request struct for DeployContractSolidityBytecodeNoKeychainV1Request +type DeployContractSolidityBytecodeNoKeychainV1Request 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"` + // For use when not using keychain, pass the contract in as this string variable + ContractJSONString *string `json:"contractJSONString,omitempty"` + 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"` + 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"` +} + +// NewDeployContractSolidityBytecodeNoKeychainV1Request instantiates a new DeployContractSolidityBytecodeNoKeychainV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractSolidityBytecodeNoKeychainV1Request(contractName string, contractAbi []interface{}, constructorArgs []interface{}, web3SigningCredential Web3SigningCredential, bytecode string) *DeployContractSolidityBytecodeNoKeychainV1Request { + this := DeployContractSolidityBytecodeNoKeychainV1Request{} + this.ContractName = contractName + this.ContractAbi = contractAbi + this.ConstructorArgs = constructorArgs + this.Web3SigningCredential = web3SigningCredential + this.Bytecode = bytecode + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// NewDeployContractSolidityBytecodeNoKeychainV1RequestWithDefaults instantiates a new DeployContractSolidityBytecodeNoKeychainV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractSolidityBytecodeNoKeychainV1RequestWithDefaults() *DeployContractSolidityBytecodeNoKeychainV1Request { + this := DeployContractSolidityBytecodeNoKeychainV1Request{} + var timeoutMs float32 = 60000 + this.TimeoutMs = &timeoutMs + return &this +} + +// GetContractName returns the ContractName field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) GetContractNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractName, true +} + +// SetContractName sets field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetContractName(v string) { + o.ContractName = v +} + +// GetContractAbi returns the ContractAbi field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) GetContractAbiOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ContractAbi, true +} + +// SetContractAbi sets field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetContractAbi(v []interface{}) { + o.ContractAbi = v +} + +// GetContractJSONString returns the ContractJSONString field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) GetContractJSONString() string { + if o == nil || IsNil(o.ContractJSONString) { + var ret string + return ret + } + return *o.ContractJSONString +} + +// GetContractJSONStringOk returns a tuple with the ContractJSONString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) GetContractJSONStringOk() (*string, bool) { + if o == nil || IsNil(o.ContractJSONString) { + return nil, false + } + return o.ContractJSONString, true +} + +// HasContractJSONString returns a boolean if a field has been set. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) HasContractJSONString() bool { + if o != nil && !IsNil(o.ContractJSONString) { + return true + } + + return false +} + +// SetContractJSONString gets a reference to the given string and assigns it to the ContractJSONString field. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetContractJSONString(v string) { + o.ContractJSONString = &v +} + +// GetConstructorArgs returns the ConstructorArgs field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) GetConstructorArgsOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.ConstructorArgs, true +} + +// SetConstructorArgs sets field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetConstructorArgs(v []interface{}) { + o.ConstructorArgs = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetBytecode returns the Bytecode field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) GetBytecodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Bytecode, true +} + +// SetBytecode sets field value +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) SetBytecode(v string) { + o.Bytecode = v +} + +// GetGas returns the Gas field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) SetGas(v float32) { + o.Gas = &v +} + +// GetGasPrice returns the GasPrice field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) SetGasPrice(v string) { + o.GasPrice = &v +} + +// GetTimeoutMs returns the TimeoutMs field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) SetTimeoutMs(v float32) { + o.TimeoutMs = &v +} + +// GetPrivateTransactionConfig returns the PrivateTransactionConfig field value if set, zero value otherwise. +func (o *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) 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 *DeployContractSolidityBytecodeNoKeychainV1Request) SetPrivateTransactionConfig(v BesuPrivateTransactionConfig) { + o.PrivateTransactionConfig = &v +} + +func (o DeployContractSolidityBytecodeNoKeychainV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractSolidityBytecodeNoKeychainV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["contractName"] = o.ContractName + toSerialize["contractAbi"] = o.ContractAbi + if !IsNil(o.ContractJSONString) { + toSerialize["contractJSONString"] = o.ContractJSONString + } + toSerialize["constructorArgs"] = o.ConstructorArgs + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["bytecode"] = o.Bytecode + 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 NullableDeployContractSolidityBytecodeNoKeychainV1Request struct { + value *DeployContractSolidityBytecodeNoKeychainV1Request + isSet bool +} + +func (v NullableDeployContractSolidityBytecodeNoKeychainV1Request) Get() *DeployContractSolidityBytecodeNoKeychainV1Request { + return v.value +} + +func (v *NullableDeployContractSolidityBytecodeNoKeychainV1Request) Set(val *DeployContractSolidityBytecodeNoKeychainV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractSolidityBytecodeNoKeychainV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractSolidityBytecodeNoKeychainV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractSolidityBytecodeNoKeychainV1Request(val *DeployContractSolidityBytecodeNoKeychainV1Request) *NullableDeployContractSolidityBytecodeNoKeychainV1Request { + return &NullableDeployContractSolidityBytecodeNoKeychainV1Request{value: val, isSet: true} +} + +func (v NullableDeployContractSolidityBytecodeNoKeychainV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractSolidityBytecodeNoKeychainV1Request) 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..4ce3d8d6a19 --- /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: 2.0.0-rc.3 +*/ + +// 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..c57f6bdbf4d --- /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: 2.0.0-rc.3 +*/ + +// 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..5ec83146b6a --- /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: 2.0.0-rc.3 +*/ + +// 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..6a37c7a9dca --- /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: 2.0.0-rc.3 +*/ + +// 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..1f7a2a0b771 --- /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: 2.0.0-rc.3 +*/ + +// 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..302b3327ab6 --- /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: 2.0.0-rc.3 +*/ + +// 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..48d5b95055a --- /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: 2.0.0-rc.3 +*/ + +// 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..c4bb4d5cc55 --- /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: 2.0.0-rc.3 +*/ + +// 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..7ef3b7f2c44 --- /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: 2.0.0-rc.3 +*/ + +// 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..2b81b3c8b79 --- /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: 2.0.0-rc.3 +*/ + +// 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..8a3b10d95ad --- /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: 2.0.0-rc.3 +*/ + +// 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..654c8fe3474 --- /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: 2.0.0-rc.3 +*/ + +// 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..fbe92e874d4 --- /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: 2.0.0-rc.3 +*/ + +// 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..b8def03a56a --- /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: 2.0.0-rc.3 +*/ + +// 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..2a6f6eefd17 --- /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: 2.0.0-rc.3 +*/ + +// 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..5388aca846c --- /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: 2.0.0-rc.3 +*/ + +// 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..6a2dfb28c1e --- /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: 2.0.0-rc.3 +*/ + +// 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..a435abeb8ba --- /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: 2.0.0-rc.3 +*/ + +// 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..cbf678ebc60 --- /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: 2.0.0-rc.3 +*/ + +// 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..f161e94919c --- /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: 2.0.0-rc.3 +*/ + +// 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..a3fd9c90f16 --- /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: 2.0.0-rc.3 +*/ + +// 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..0643a251ed1 --- /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: 2.0.0-rc.3 +*/ + +// 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..cc602ef1441 --- /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: 2.0.0-rc.3 +*/ + +// 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..51cc91b481c --- /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: 2.0.0-rc.3 +*/ + +// 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..2ac4f0e395c --- /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: 2.0.0-rc.3 +*/ + +// 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..c3642d3f6c7 --- /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: 2.0.0-rc.3 +*/ + +// 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..4716a6715c9 --- /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: 2.0.0-rc.3 +*/ + +// 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..06340b4cf0a --- /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: 2.0.0-rc.3 +*/ + +// 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..c360ac60650 --- /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: 2.0.0-rc.3 +*/ + +// 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_watch_blocks_v1_request.go b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_request.go new file mode 100644 index 00000000000..d7effd253b8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-besu/src/main/go/generated/openapi/go-client/model_watch_blocks_v1_request.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Besu + +Can perform basic tasks on a Besu ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-besu + +import ( + "encoding/json" +) + +// checks if the WatchBlocksV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WatchBlocksV1Request{} + +// WatchBlocksV1Request struct for WatchBlocksV1Request +type WatchBlocksV1Request struct { + Event WatchBlocksV1 `json:"event"` +} + +// NewWatchBlocksV1Request instantiates a new WatchBlocksV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWatchBlocksV1Request(event WatchBlocksV1) *WatchBlocksV1Request { + this := WatchBlocksV1Request{} + this.Event = event + return &this +} + +// NewWatchBlocksV1RequestWithDefaults instantiates a new WatchBlocksV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWatchBlocksV1RequestWithDefaults() *WatchBlocksV1Request { + this := WatchBlocksV1Request{} + return &this +} + +// GetEvent returns the Event field value +func (o *WatchBlocksV1Request) GetEvent() WatchBlocksV1 { + if o == nil { + var ret WatchBlocksV1 + return ret + } + + return o.Event +} + +// GetEventOk returns a tuple with the Event field value +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Request) GetEventOk() (*WatchBlocksV1, bool) { + if o == nil { + return nil, false + } + return &o.Event, true +} + +// SetEvent sets field value +func (o *WatchBlocksV1Request) SetEvent(v WatchBlocksV1) { + o.Event = v +} + +func (o WatchBlocksV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WatchBlocksV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["event"] = o.Event + return toSerialize, nil +} + +type NullableWatchBlocksV1Request struct { + value *WatchBlocksV1Request + isSet bool +} + +func (v NullableWatchBlocksV1Request) Get() *WatchBlocksV1Request { + return v.value +} + +func (v *NullableWatchBlocksV1Request) Set(val *WatchBlocksV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableWatchBlocksV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableWatchBlocksV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWatchBlocksV1Request(val *WatchBlocksV1Request) *NullableWatchBlocksV1Request { + return &NullableWatchBlocksV1Request{value: val, isSet: true} +} + +func (v NullableWatchBlocksV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWatchBlocksV1Request) 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..e91871cc607 --- /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: 2.0.0-rc.3 +*/ + +// 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..bf82147a656 --- /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: 2.0.0-rc.3 +*/ + +// 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..ceeaeb9cad5 --- /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: 2.0.0-rc.3 +*/ + +// 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..fa41011b91b --- /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: 2.0.0-rc.3 +*/ + +// 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..e0dbb8b0d1e --- /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: 2.0.0-rc.3 +*/ + +// 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..6a8136ef8a1 --- /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: 2.0.0-rc.3 +*/ + +// 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..7317199b9fe --- /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: 2.0.0-rc.3 +*/ + +// 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..e3914a05768 --- /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: 2.0.0-rc.3 +*/ + +// 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..ac36a96c830 --- /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: 2.0.0-rc.3 +*/ + +// 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..636d6720fe7 --- /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: 2.0.0-rc.3 +*/ + +// 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-cdl/package.json b/packages/cactus-plugin-ledger-connector-cdl/package.json index 67644735bc4..1a932ce5e46 100644 --- a/packages/cactus-plugin-ledger-connector-cdl/package.json +++ b/packages/cactus-plugin-ledger-connector-cdl/package.json @@ -44,9 +44,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "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-cdl/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..f21f7bb0622 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/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_auth_info_access_token_v1.go +model_auth_info_subscription_key_v1.go +model_auth_info_v1.go +model_cdl_common_response_v1.go +model_error_exception_response_v1.go +model_event_lineage_v1.go +model_gateway_configuration_v1.go +model_get_lineage_option_direction_v1.go +model_get_lineage_request_v1.go +model_get_lineage_response_v1.go +model_register_history_data_request_v1.go +model_register_history_data_v1_response.go +model_search_lineage_request_v1.go +model_search_lineage_response_v1.go +model_search_lineage_type_v1.go +model_trail_event_details_v1.go +response.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-cdl/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-cdl/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-cdl/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/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-cdl/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..ba58444f7b0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,130 @@ +# Go API client for cactus-plugin-ledger-connector-cdl + +Can perform basic tasks on Fujitsu CDL service. + +## 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: 2.0.0-rc.3 +- 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-cdl "github.com/hyperledger/cactus-plugin-ledger-connector-cdl/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-cdl.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-cdl.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-cdl.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-cdl.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* | [**GetLineageV1**](docs/DefaultApi.md#getlineagev1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/get-lineage | Get lineage trail from CDL. +*DefaultApi* | [**RegisterHistoryDataV1**](docs/DefaultApi.md#registerhistorydatav1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/register-history-data | Register new data trail on CDL +*DefaultApi* | [**SearchLineageByGlobalDataV1**](docs/DefaultApi.md#searchlineagebyglobaldatav1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-globaldata | Search lineage using global data fields. +*DefaultApi* | [**SearchLineageByHeaderV1**](docs/DefaultApi.md#searchlineagebyheaderv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-header | Search lineage using header fields. + + +## Documentation For Models + + - [AuthInfoAccessTokenV1](docs/AuthInfoAccessTokenV1.md) + - [AuthInfoSubscriptionKeyV1](docs/AuthInfoSubscriptionKeyV1.md) + - [AuthInfoV1](docs/AuthInfoV1.md) + - [CDLCommonResponseV1](docs/CDLCommonResponseV1.md) + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [EventLineageV1](docs/EventLineageV1.md) + - [GatewayConfigurationV1](docs/GatewayConfigurationV1.md) + - [GetLineageOptionDirectionV1](docs/GetLineageOptionDirectionV1.md) + - [GetLineageRequestV1](docs/GetLineageRequestV1.md) + - [GetLineageResponseV1](docs/GetLineageResponseV1.md) + - [RegisterHistoryDataRequestV1](docs/RegisterHistoryDataRequestV1.md) + - [RegisterHistoryDataV1Response](docs/RegisterHistoryDataV1Response.md) + - [SearchLineageRequestV1](docs/SearchLineageRequestV1.md) + - [SearchLineageResponseV1](docs/SearchLineageResponseV1.md) + - [SearchLineageTypeV1](docs/SearchLineageTypeV1.md) + - [TrailEventDetailsV1](docs/TrailEventDetailsV1.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-cdl/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..a1bfaa66739 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,498 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on Fujitsu CDL service. + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cacti Plugin - Connector CDL + version: 2.0.0-rc.3 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/register-history-data: + post: + operationId: registerHistoryDataV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterHistoryDataRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterHistoryDataV1Response' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Register new data trail on CDL + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/register-history-data + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/get-lineage: + post: + operationId: getLineageV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetLineageRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetLineageResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get lineage trail from CDL. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/get-lineage + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-header: + post: + operationId: searchLineageByHeaderV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SearchLineageRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SearchLineageResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Search lineage using header fields. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-header + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-globaldata: + post: + operationId: searchLineageByGlobalDataV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SearchLineageRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SearchLineageResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Search lineage using global data fields. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-globaldata +components: + schemas: + GetLineageOptionDirectionV1: + enum: + - backward + - forward + - both + type: string + x-enum-varnames: + - Backward + - Forward + - Both + SearchLineageTypeV1: + enum: + - exactmatch + - partialmatch + - regexpmatch + type: string + x-enum-varnames: + - ExactMatch + - PartialMatch + - RegexMatch + GatewayConfigurationV1: + properties: + url: + description: Gateway URL + nullable: false + type: string + userAgent: + description: Value of User-Agent header sent to CDL (to identify this client) + nullable: false + type: string + skipCertCheck: + default: false + description: Set to true to ignore self-signed and other rejected certificates + nullable: false + type: boolean + caPath: + description: CA of CDL API gateway server in PEM format to use + nullable: false + type: string + serverName: + description: Overwrite server name from cdlApiGateway.url to match one specified + in CA + nullable: false + type: string + required: + - url + type: object + AuthInfoAccessTokenV1: + properties: + accessToken: + nullable: false + type: string + trustAgentId: + nullable: false + type: string + required: + - accessToken + - trustAgentId + type: object + AuthInfoSubscriptionKeyV1: + properties: + subscriptionKey: + nullable: false + type: string + trustAgentId: + nullable: false + type: string + trustAgentRole: + nullable: false + type: string + trustUserId: + nullable: false + type: string + trustUserRole: + nullable: false + type: string + required: + - subscriptionKey + - trustAgentId + - trustAgentRole + - trustUserId + - trustUserRole + type: object + AuthInfoV1: + oneOf: + - $ref: '#/components/schemas/AuthInfoAccessTokenV1' + - $ref: '#/components/schemas/AuthInfoSubscriptionKeyV1' + type: object + EventLineageV1: + description: CDL event linage information (used to identify related events) + example: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + properties: + cdl:EventId: + nullable: false + type: ' string' + cdl:LineageId: + nullable: false + type: ' string' + cdl:DataModelMode: + nullable: false + type: ' string' + cdl:DataModelVersion: + nullable: false + type: ' string' + cdl:DataRegistrationTimeStamp: + nullable: false + type: ' string' + cdl:NextEventIdList: + items: + nullable: false + type: ' string' + type: array + cdl:PreviousEventIdList: + items: + nullable: false + type: ' string' + type: array + required: + - cdl:DataModelMode + - cdl:DataModelVersion + - cdl:DataRegistrationTimeStamp + - cdl:EventId + - cdl:LineageId + - cdl:NextEventIdList + - cdl:PreviousEventIdList + type: object + TrailEventDetailsV1: + description: Details of newly created CDL event. + example: + cdl:Event: "" + cdl:Lineage: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + cdl:Verification: "" + cdl:Tags: "" + properties: + cdl:Event: + nullable: false + cdl:Lineage: + $ref: '#/components/schemas/EventLineageV1' + cdl:Tags: + nullable: false + cdl:Verification: + nullable: false + required: + - cdl:Lineage + - cdl:Tags + - cdl:Verification + type: object + CDLCommonResponseV1: + properties: + detail: + nullable: false + result: + nullable: false + type: ' string' + required: + - result + type: object + RegisterHistoryDataRequestV1: + example: + eventId: eventId + lineageId: lineageId + properties: "" + authInfo: null + tags: "" + properties: + authInfo: + $ref: '#/components/schemas/AuthInfoV1' + eventId: + nullable: false + type: string + lineageId: + nullable: false + type: string + tags: + nullable: false + properties: + nullable: false + required: + - authInfo + type: object + RegisterHistoryDataV1Response: + example: + result: "" + detail: + cdl:Event: "" + cdl:Lineage: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + cdl:Verification: "" + cdl:Tags: "" + properties: + detail: + $ref: '#/components/schemas/TrailEventDetailsV1' + result: + nullable: false + type: ' string' + required: + - detail + - result + type: object + GetLineageRequestV1: + example: + eventId: eventId + depth: "-1" + authInfo: null + direction: null + properties: + authInfo: + $ref: '#/components/schemas/AuthInfoV1' + eventId: + nullable: false + type: string + direction: + $ref: '#/components/schemas/GetLineageOptionDirectionV1' + depth: + default: "-1" + nullable: false + type: string + required: + - authInfo + - eventId + type: object + GetLineageResponseV1: + example: + result: "" + detail: + - cdl:Event: "" + cdl:Lineage: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + cdl:Verification: "" + cdl:Tags: "" + - cdl:Event: "" + cdl:Lineage: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + cdl:Verification: "" + cdl:Tags: "" + properties: + detail: + items: + $ref: '#/components/schemas/TrailEventDetailsV1' + type: array + result: + nullable: false + type: ' string' + required: + - detail + - result + type: object + SearchLineageRequestV1: + example: + searchType: null + fields: "" + authInfo: null + properties: + authInfo: + $ref: '#/components/schemas/AuthInfoV1' + searchType: + $ref: '#/components/schemas/SearchLineageTypeV1' + fields: + nullable: false + required: + - authInfo + - fields + - searchType + type: object + SearchLineageResponseV1: + example: + result: "" + detail: + - cdl:Event: "" + cdl:Lineage: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + cdl:Verification: "" + cdl:Tags: "" + - cdl:Event: "" + cdl:Lineage: + cdl:NextEventIdList: + - "" + - "" + cdl:DataModelMode: "" + cdl:EventId: "" + cdl:PreviousEventIdList: + - "" + - "" + cdl:LineageId: "" + cdl:DataRegistrationTimeStamp: "" + cdl:DataModelVersion: "" + cdl:Verification: "" + cdl:Tags: "" + properties: + detail: + items: + $ref: '#/components/schemas/TrailEventDetailsV1' + type: array + result: + nullable: false + type: ' string' + required: + - detail + - result + 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 diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..cbadc974423 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,483 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiGetLineageV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getLineageRequestV1 *GetLineageRequestV1 +} + +func (r ApiGetLineageV1Request) GetLineageRequestV1(getLineageRequestV1 GetLineageRequestV1) ApiGetLineageV1Request { + r.getLineageRequestV1 = &getLineageRequestV1 + return r +} + +func (r ApiGetLineageV1Request) Execute() (*GetLineageResponseV1, *http.Response, error) { + return r.ApiService.GetLineageV1Execute(r) +} + +/* +GetLineageV1 Get lineage trail from CDL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetLineageV1Request +*/ +func (a *DefaultApiService) GetLineageV1(ctx context.Context) ApiGetLineageV1Request { + return ApiGetLineageV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetLineageResponseV1 +func (a *DefaultApiService) GetLineageV1Execute(r ApiGetLineageV1Request) (*GetLineageResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLineageResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetLineageV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/get-lineage" + + 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.getLineageRequestV1 + 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 ApiRegisterHistoryDataV1Request struct { + ctx context.Context + ApiService *DefaultApiService + registerHistoryDataRequestV1 *RegisterHistoryDataRequestV1 +} + +func (r ApiRegisterHistoryDataV1Request) RegisterHistoryDataRequestV1(registerHistoryDataRequestV1 RegisterHistoryDataRequestV1) ApiRegisterHistoryDataV1Request { + r.registerHistoryDataRequestV1 = ®isterHistoryDataRequestV1 + return r +} + +func (r ApiRegisterHistoryDataV1Request) Execute() (*RegisterHistoryDataV1Response, *http.Response, error) { + return r.ApiService.RegisterHistoryDataV1Execute(r) +} + +/* +RegisterHistoryDataV1 Register new data trail on CDL + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRegisterHistoryDataV1Request +*/ +func (a *DefaultApiService) RegisterHistoryDataV1(ctx context.Context) ApiRegisterHistoryDataV1Request { + return ApiRegisterHistoryDataV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RegisterHistoryDataV1Response +func (a *DefaultApiService) RegisterHistoryDataV1Execute(r ApiRegisterHistoryDataV1Request) (*RegisterHistoryDataV1Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegisterHistoryDataV1Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RegisterHistoryDataV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/register-history-data" + + 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.registerHistoryDataRequestV1 + 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 ApiSearchLineageByGlobalDataV1Request struct { + ctx context.Context + ApiService *DefaultApiService + searchLineageRequestV1 *SearchLineageRequestV1 +} + +func (r ApiSearchLineageByGlobalDataV1Request) SearchLineageRequestV1(searchLineageRequestV1 SearchLineageRequestV1) ApiSearchLineageByGlobalDataV1Request { + r.searchLineageRequestV1 = &searchLineageRequestV1 + return r +} + +func (r ApiSearchLineageByGlobalDataV1Request) Execute() (*SearchLineageResponseV1, *http.Response, error) { + return r.ApiService.SearchLineageByGlobalDataV1Execute(r) +} + +/* +SearchLineageByGlobalDataV1 Search lineage using global data fields. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSearchLineageByGlobalDataV1Request +*/ +func (a *DefaultApiService) SearchLineageByGlobalDataV1(ctx context.Context) ApiSearchLineageByGlobalDataV1Request { + return ApiSearchLineageByGlobalDataV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SearchLineageResponseV1 +func (a *DefaultApiService) SearchLineageByGlobalDataV1Execute(r ApiSearchLineageByGlobalDataV1Request) (*SearchLineageResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SearchLineageResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SearchLineageByGlobalDataV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-globaldata" + + 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.searchLineageRequestV1 + 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 ApiSearchLineageByHeaderV1Request struct { + ctx context.Context + ApiService *DefaultApiService + searchLineageRequestV1 *SearchLineageRequestV1 +} + +func (r ApiSearchLineageByHeaderV1Request) SearchLineageRequestV1(searchLineageRequestV1 SearchLineageRequestV1) ApiSearchLineageByHeaderV1Request { + r.searchLineageRequestV1 = &searchLineageRequestV1 + return r +} + +func (r ApiSearchLineageByHeaderV1Request) Execute() (*SearchLineageResponseV1, *http.Response, error) { + return r.ApiService.SearchLineageByHeaderV1Execute(r) +} + +/* +SearchLineageByHeaderV1 Search lineage using header fields. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSearchLineageByHeaderV1Request +*/ +func (a *DefaultApiService) SearchLineageByHeaderV1(ctx context.Context) ApiSearchLineageByHeaderV1Request { + return ApiSearchLineageByHeaderV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SearchLineageResponseV1 +func (a *DefaultApiService) SearchLineageByHeaderV1Execute(r ApiSearchLineageByHeaderV1Request) (*SearchLineageResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SearchLineageResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SearchLineageByHeaderV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-cdl/search-lineage-by-header" + + 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.searchLineageRequestV1 + 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-cdl/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..5d01087b76e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,655 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +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 CDL API v2.0.0-rc.3 +// 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-cdl/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..ab42e8ecfda --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +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-cdl/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..f01a23d7789 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client + +go 1.13 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/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-cdl/src/main/go/generated/openapi/go-client/model_auth_info_access_token_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_access_token_v1.go new file mode 100644 index 00000000000..a79f0a26a52 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_access_token_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the AuthInfoAccessTokenV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthInfoAccessTokenV1{} + +// AuthInfoAccessTokenV1 struct for AuthInfoAccessTokenV1 +type AuthInfoAccessTokenV1 struct { + AccessToken string `json:"accessToken"` + TrustAgentId string `json:"trustAgentId"` +} + +// NewAuthInfoAccessTokenV1 instantiates a new AuthInfoAccessTokenV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthInfoAccessTokenV1(accessToken string, trustAgentId string) *AuthInfoAccessTokenV1 { + this := AuthInfoAccessTokenV1{} + this.AccessToken = accessToken + this.TrustAgentId = trustAgentId + return &this +} + +// NewAuthInfoAccessTokenV1WithDefaults instantiates a new AuthInfoAccessTokenV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthInfoAccessTokenV1WithDefaults() *AuthInfoAccessTokenV1 { + this := AuthInfoAccessTokenV1{} + return &this +} + +// GetAccessToken returns the AccessToken field value +func (o *AuthInfoAccessTokenV1) GetAccessToken() string { + if o == nil { + var ret string + return ret + } + + return o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value +// and a boolean to check if the value has been set. +func (o *AuthInfoAccessTokenV1) GetAccessTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessToken, true +} + +// SetAccessToken sets field value +func (o *AuthInfoAccessTokenV1) SetAccessToken(v string) { + o.AccessToken = v +} + +// GetTrustAgentId returns the TrustAgentId field value +func (o *AuthInfoAccessTokenV1) GetTrustAgentId() string { + if o == nil { + var ret string + return ret + } + + return o.TrustAgentId +} + +// GetTrustAgentIdOk returns a tuple with the TrustAgentId field value +// and a boolean to check if the value has been set. +func (o *AuthInfoAccessTokenV1) GetTrustAgentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TrustAgentId, true +} + +// SetTrustAgentId sets field value +func (o *AuthInfoAccessTokenV1) SetTrustAgentId(v string) { + o.TrustAgentId = v +} + +func (o AuthInfoAccessTokenV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthInfoAccessTokenV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accessToken"] = o.AccessToken + toSerialize["trustAgentId"] = o.TrustAgentId + return toSerialize, nil +} + +type NullableAuthInfoAccessTokenV1 struct { + value *AuthInfoAccessTokenV1 + isSet bool +} + +func (v NullableAuthInfoAccessTokenV1) Get() *AuthInfoAccessTokenV1 { + return v.value +} + +func (v *NullableAuthInfoAccessTokenV1) Set(val *AuthInfoAccessTokenV1) { + v.value = val + v.isSet = true +} + +func (v NullableAuthInfoAccessTokenV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthInfoAccessTokenV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthInfoAccessTokenV1(val *AuthInfoAccessTokenV1) *NullableAuthInfoAccessTokenV1 { + return &NullableAuthInfoAccessTokenV1{value: val, isSet: true} +} + +func (v NullableAuthInfoAccessTokenV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthInfoAccessTokenV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_subscription_key_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_subscription_key_v1.go new file mode 100644 index 00000000000..6bc0558025b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_subscription_key_v1.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the AuthInfoSubscriptionKeyV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthInfoSubscriptionKeyV1{} + +// AuthInfoSubscriptionKeyV1 struct for AuthInfoSubscriptionKeyV1 +type AuthInfoSubscriptionKeyV1 struct { + SubscriptionKey string `json:"subscriptionKey"` + TrustAgentId string `json:"trustAgentId"` + TrustAgentRole string `json:"trustAgentRole"` + TrustUserId string `json:"trustUserId"` + TrustUserRole string `json:"trustUserRole"` +} + +// NewAuthInfoSubscriptionKeyV1 instantiates a new AuthInfoSubscriptionKeyV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthInfoSubscriptionKeyV1(subscriptionKey string, trustAgentId string, trustAgentRole string, trustUserId string, trustUserRole string) *AuthInfoSubscriptionKeyV1 { + this := AuthInfoSubscriptionKeyV1{} + this.SubscriptionKey = subscriptionKey + this.TrustAgentId = trustAgentId + this.TrustAgentRole = trustAgentRole + this.TrustUserId = trustUserId + this.TrustUserRole = trustUserRole + return &this +} + +// NewAuthInfoSubscriptionKeyV1WithDefaults instantiates a new AuthInfoSubscriptionKeyV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthInfoSubscriptionKeyV1WithDefaults() *AuthInfoSubscriptionKeyV1 { + this := AuthInfoSubscriptionKeyV1{} + return &this +} + +// GetSubscriptionKey returns the SubscriptionKey field value +func (o *AuthInfoSubscriptionKeyV1) GetSubscriptionKey() string { + if o == nil { + var ret string + return ret + } + + return o.SubscriptionKey +} + +// GetSubscriptionKeyOk returns a tuple with the SubscriptionKey field value +// and a boolean to check if the value has been set. +func (o *AuthInfoSubscriptionKeyV1) GetSubscriptionKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SubscriptionKey, true +} + +// SetSubscriptionKey sets field value +func (o *AuthInfoSubscriptionKeyV1) SetSubscriptionKey(v string) { + o.SubscriptionKey = v +} + +// GetTrustAgentId returns the TrustAgentId field value +func (o *AuthInfoSubscriptionKeyV1) GetTrustAgentId() string { + if o == nil { + var ret string + return ret + } + + return o.TrustAgentId +} + +// GetTrustAgentIdOk returns a tuple with the TrustAgentId field value +// and a boolean to check if the value has been set. +func (o *AuthInfoSubscriptionKeyV1) GetTrustAgentIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TrustAgentId, true +} + +// SetTrustAgentId sets field value +func (o *AuthInfoSubscriptionKeyV1) SetTrustAgentId(v string) { + o.TrustAgentId = v +} + +// GetTrustAgentRole returns the TrustAgentRole field value +func (o *AuthInfoSubscriptionKeyV1) GetTrustAgentRole() string { + if o == nil { + var ret string + return ret + } + + return o.TrustAgentRole +} + +// GetTrustAgentRoleOk returns a tuple with the TrustAgentRole field value +// and a boolean to check if the value has been set. +func (o *AuthInfoSubscriptionKeyV1) GetTrustAgentRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TrustAgentRole, true +} + +// SetTrustAgentRole sets field value +func (o *AuthInfoSubscriptionKeyV1) SetTrustAgentRole(v string) { + o.TrustAgentRole = v +} + +// GetTrustUserId returns the TrustUserId field value +func (o *AuthInfoSubscriptionKeyV1) GetTrustUserId() string { + if o == nil { + var ret string + return ret + } + + return o.TrustUserId +} + +// GetTrustUserIdOk returns a tuple with the TrustUserId field value +// and a boolean to check if the value has been set. +func (o *AuthInfoSubscriptionKeyV1) GetTrustUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TrustUserId, true +} + +// SetTrustUserId sets field value +func (o *AuthInfoSubscriptionKeyV1) SetTrustUserId(v string) { + o.TrustUserId = v +} + +// GetTrustUserRole returns the TrustUserRole field value +func (o *AuthInfoSubscriptionKeyV1) GetTrustUserRole() string { + if o == nil { + var ret string + return ret + } + + return o.TrustUserRole +} + +// GetTrustUserRoleOk returns a tuple with the TrustUserRole field value +// and a boolean to check if the value has been set. +func (o *AuthInfoSubscriptionKeyV1) GetTrustUserRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TrustUserRole, true +} + +// SetTrustUserRole sets field value +func (o *AuthInfoSubscriptionKeyV1) SetTrustUserRole(v string) { + o.TrustUserRole = v +} + +func (o AuthInfoSubscriptionKeyV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthInfoSubscriptionKeyV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["subscriptionKey"] = o.SubscriptionKey + toSerialize["trustAgentId"] = o.TrustAgentId + toSerialize["trustAgentRole"] = o.TrustAgentRole + toSerialize["trustUserId"] = o.TrustUserId + toSerialize["trustUserRole"] = o.TrustUserRole + return toSerialize, nil +} + +type NullableAuthInfoSubscriptionKeyV1 struct { + value *AuthInfoSubscriptionKeyV1 + isSet bool +} + +func (v NullableAuthInfoSubscriptionKeyV1) Get() *AuthInfoSubscriptionKeyV1 { + return v.value +} + +func (v *NullableAuthInfoSubscriptionKeyV1) Set(val *AuthInfoSubscriptionKeyV1) { + v.value = val + v.isSet = true +} + +func (v NullableAuthInfoSubscriptionKeyV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthInfoSubscriptionKeyV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthInfoSubscriptionKeyV1(val *AuthInfoSubscriptionKeyV1) *NullableAuthInfoSubscriptionKeyV1 { + return &NullableAuthInfoSubscriptionKeyV1{value: val, isSet: true} +} + +func (v NullableAuthInfoSubscriptionKeyV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthInfoSubscriptionKeyV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_v1.go new file mode 100644 index 00000000000..c5ba58213fd --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_auth_info_v1.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" + "fmt" +) + +// AuthInfoV1 - struct for AuthInfoV1 +type AuthInfoV1 struct { + AuthInfoAccessTokenV1 *AuthInfoAccessTokenV1 + AuthInfoSubscriptionKeyV1 *AuthInfoSubscriptionKeyV1 +} + +// AuthInfoAccessTokenV1AsAuthInfoV1 is a convenience function that returns AuthInfoAccessTokenV1 wrapped in AuthInfoV1 +func AuthInfoAccessTokenV1AsAuthInfoV1(v *AuthInfoAccessTokenV1) AuthInfoV1 { + return AuthInfoV1{ + AuthInfoAccessTokenV1: v, + } +} + +// AuthInfoSubscriptionKeyV1AsAuthInfoV1 is a convenience function that returns AuthInfoSubscriptionKeyV1 wrapped in AuthInfoV1 +func AuthInfoSubscriptionKeyV1AsAuthInfoV1(v *AuthInfoSubscriptionKeyV1) AuthInfoV1 { + return AuthInfoV1{ + AuthInfoSubscriptionKeyV1: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AuthInfoV1) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into AuthInfoAccessTokenV1 + err = newStrictDecoder(data).Decode(&dst.AuthInfoAccessTokenV1) + if err == nil { + jsonAuthInfoAccessTokenV1, _ := json.Marshal(dst.AuthInfoAccessTokenV1) + if string(jsonAuthInfoAccessTokenV1) == "{}" { // empty struct + dst.AuthInfoAccessTokenV1 = nil + } else { + match++ + } + } else { + dst.AuthInfoAccessTokenV1 = nil + } + + // try to unmarshal data into AuthInfoSubscriptionKeyV1 + err = newStrictDecoder(data).Decode(&dst.AuthInfoSubscriptionKeyV1) + if err == nil { + jsonAuthInfoSubscriptionKeyV1, _ := json.Marshal(dst.AuthInfoSubscriptionKeyV1) + if string(jsonAuthInfoSubscriptionKeyV1) == "{}" { // empty struct + dst.AuthInfoSubscriptionKeyV1 = nil + } else { + match++ + } + } else { + dst.AuthInfoSubscriptionKeyV1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.AuthInfoAccessTokenV1 = nil + dst.AuthInfoSubscriptionKeyV1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AuthInfoV1)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AuthInfoV1)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AuthInfoV1) MarshalJSON() ([]byte, error) { + if src.AuthInfoAccessTokenV1 != nil { + return json.Marshal(&src.AuthInfoAccessTokenV1) + } + + if src.AuthInfoSubscriptionKeyV1 != nil { + return json.Marshal(&src.AuthInfoSubscriptionKeyV1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AuthInfoV1) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.AuthInfoAccessTokenV1 != nil { + return obj.AuthInfoAccessTokenV1 + } + + if obj.AuthInfoSubscriptionKeyV1 != nil { + return obj.AuthInfoSubscriptionKeyV1 + } + + // all schemas are nil + return nil +} + +type NullableAuthInfoV1 struct { + value *AuthInfoV1 + isSet bool +} + +func (v NullableAuthInfoV1) Get() *AuthInfoV1 { + return v.value +} + +func (v *NullableAuthInfoV1) Set(val *AuthInfoV1) { + v.value = val + v.isSet = true +} + +func (v NullableAuthInfoV1) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthInfoV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthInfoV1(val *AuthInfoV1) *NullableAuthInfoV1 { + return &NullableAuthInfoV1{value: val, isSet: true} +} + +func (v NullableAuthInfoV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthInfoV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_cdl_common_response_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_cdl_common_response_v1.go new file mode 100644 index 00000000000..02708557411 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_cdl_common_response_v1.go @@ -0,0 +1,154 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the CDLCommonResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CDLCommonResponseV1{} + +// CDLCommonResponseV1 struct for CDLCommonResponseV1 +type CDLCommonResponseV1 struct { + Detail interface{} `json:"detail,omitempty"` + Result String `json:"result"` +} + +// NewCDLCommonResponseV1 instantiates a new CDLCommonResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCDLCommonResponseV1(result String) *CDLCommonResponseV1 { + this := CDLCommonResponseV1{} + this.Result = result + return &this +} + +// NewCDLCommonResponseV1WithDefaults instantiates a new CDLCommonResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCDLCommonResponseV1WithDefaults() *CDLCommonResponseV1 { + this := CDLCommonResponseV1{} + return &this +} + +// GetDetail returns the Detail field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CDLCommonResponseV1) GetDetail() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail 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 *CDLCommonResponseV1) GetDetailOk() (*interface{}, bool) { + if o == nil || isNil(o.Detail) { + return nil, false + } + return &o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *CDLCommonResponseV1) HasDetail() bool { + if o != nil && isNil(o.Detail) { + return true + } + + return false +} + +// SetDetail gets a reference to the given interface{} and assigns it to the Detail field. +func (o *CDLCommonResponseV1) SetDetail(v interface{}) { + o.Detail = v +} + +// GetResult returns the Result field value +func (o *CDLCommonResponseV1) GetResult() String { + if o == nil { + var ret String + return ret + } + + return o.Result +} + +// GetResultOk returns a tuple with the Result field value +// and a boolean to check if the value has been set. +func (o *CDLCommonResponseV1) GetResultOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.Result, true +} + +// SetResult sets field value +func (o *CDLCommonResponseV1) SetResult(v String) { + o.Result = v +} + +func (o CDLCommonResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CDLCommonResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + toSerialize["result"] = o.Result + return toSerialize, nil +} + +type NullableCDLCommonResponseV1 struct { + value *CDLCommonResponseV1 + isSet bool +} + +func (v NullableCDLCommonResponseV1) Get() *CDLCommonResponseV1 { + return v.value +} + +func (v *NullableCDLCommonResponseV1) Set(val *CDLCommonResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableCDLCommonResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCDLCommonResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCDLCommonResponseV1(val *CDLCommonResponseV1) *NullableCDLCommonResponseV1 { + return &NullableCDLCommonResponseV1{value: val, isSet: true} +} + +func (v NullableCDLCommonResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCDLCommonResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..1b94e73d073 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +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-cdl/src/main/go/generated/openapi/go-client/model_event_lineage_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_event_lineage_v1.go new file mode 100644 index 00000000000..5a2b53e9da9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_event_lineage_v1.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the EventLineageV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventLineageV1{} + +// EventLineageV1 CDL event linage information (used to identify related events) +type EventLineageV1 struct { + CdlEventId String `json:"cdl:EventId"` + CdlLineageId String `json:"cdl:LineageId"` + CdlDataModelMode String `json:"cdl:DataModelMode"` + CdlDataModelVersion String `json:"cdl:DataModelVersion"` + CdlDataRegistrationTimeStamp String `json:"cdl:DataRegistrationTimeStamp"` + CdlNextEventIdList []String `json:"cdl:NextEventIdList"` + CdlPreviousEventIdList []String `json:"cdl:PreviousEventIdList"` +} + +// NewEventLineageV1 instantiates a new EventLineageV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventLineageV1(cdlEventId String, cdlLineageId String, cdlDataModelMode String, cdlDataModelVersion String, cdlDataRegistrationTimeStamp String, cdlNextEventIdList []String, cdlPreviousEventIdList []String) *EventLineageV1 { + this := EventLineageV1{} + this.CdlEventId = cdlEventId + this.CdlLineageId = cdlLineageId + this.CdlDataModelMode = cdlDataModelMode + this.CdlDataModelVersion = cdlDataModelVersion + this.CdlDataRegistrationTimeStamp = cdlDataRegistrationTimeStamp + this.CdlNextEventIdList = cdlNextEventIdList + this.CdlPreviousEventIdList = cdlPreviousEventIdList + return &this +} + +// NewEventLineageV1WithDefaults instantiates a new EventLineageV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventLineageV1WithDefaults() *EventLineageV1 { + this := EventLineageV1{} + return &this +} + +// GetCdlEventId returns the CdlEventId field value +func (o *EventLineageV1) GetCdlEventId() String { + if o == nil { + var ret String + return ret + } + + return o.CdlEventId +} + +// GetCdlEventIdOk returns a tuple with the CdlEventId field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlEventIdOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.CdlEventId, true +} + +// SetCdlEventId sets field value +func (o *EventLineageV1) SetCdlEventId(v String) { + o.CdlEventId = v +} + +// GetCdlLineageId returns the CdlLineageId field value +func (o *EventLineageV1) GetCdlLineageId() String { + if o == nil { + var ret String + return ret + } + + return o.CdlLineageId +} + +// GetCdlLineageIdOk returns a tuple with the CdlLineageId field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlLineageIdOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.CdlLineageId, true +} + +// SetCdlLineageId sets field value +func (o *EventLineageV1) SetCdlLineageId(v String) { + o.CdlLineageId = v +} + +// GetCdlDataModelMode returns the CdlDataModelMode field value +func (o *EventLineageV1) GetCdlDataModelMode() String { + if o == nil { + var ret String + return ret + } + + return o.CdlDataModelMode +} + +// GetCdlDataModelModeOk returns a tuple with the CdlDataModelMode field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlDataModelModeOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.CdlDataModelMode, true +} + +// SetCdlDataModelMode sets field value +func (o *EventLineageV1) SetCdlDataModelMode(v String) { + o.CdlDataModelMode = v +} + +// GetCdlDataModelVersion returns the CdlDataModelVersion field value +func (o *EventLineageV1) GetCdlDataModelVersion() String { + if o == nil { + var ret String + return ret + } + + return o.CdlDataModelVersion +} + +// GetCdlDataModelVersionOk returns a tuple with the CdlDataModelVersion field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlDataModelVersionOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.CdlDataModelVersion, true +} + +// SetCdlDataModelVersion sets field value +func (o *EventLineageV1) SetCdlDataModelVersion(v String) { + o.CdlDataModelVersion = v +} + +// GetCdlDataRegistrationTimeStamp returns the CdlDataRegistrationTimeStamp field value +func (o *EventLineageV1) GetCdlDataRegistrationTimeStamp() String { + if o == nil { + var ret String + return ret + } + + return o.CdlDataRegistrationTimeStamp +} + +// GetCdlDataRegistrationTimeStampOk returns a tuple with the CdlDataRegistrationTimeStamp field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlDataRegistrationTimeStampOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.CdlDataRegistrationTimeStamp, true +} + +// SetCdlDataRegistrationTimeStamp sets field value +func (o *EventLineageV1) SetCdlDataRegistrationTimeStamp(v String) { + o.CdlDataRegistrationTimeStamp = v +} + +// GetCdlNextEventIdList returns the CdlNextEventIdList field value +func (o *EventLineageV1) GetCdlNextEventIdList() []String { + if o == nil { + var ret []String + return ret + } + + return o.CdlNextEventIdList +} + +// GetCdlNextEventIdListOk returns a tuple with the CdlNextEventIdList field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlNextEventIdListOk() ([]String, bool) { + if o == nil { + return nil, false + } + return o.CdlNextEventIdList, true +} + +// SetCdlNextEventIdList sets field value +func (o *EventLineageV1) SetCdlNextEventIdList(v []String) { + o.CdlNextEventIdList = v +} + +// GetCdlPreviousEventIdList returns the CdlPreviousEventIdList field value +func (o *EventLineageV1) GetCdlPreviousEventIdList() []String { + if o == nil { + var ret []String + return ret + } + + return o.CdlPreviousEventIdList +} + +// GetCdlPreviousEventIdListOk returns a tuple with the CdlPreviousEventIdList field value +// and a boolean to check if the value has been set. +func (o *EventLineageV1) GetCdlPreviousEventIdListOk() ([]String, bool) { + if o == nil { + return nil, false + } + return o.CdlPreviousEventIdList, true +} + +// SetCdlPreviousEventIdList sets field value +func (o *EventLineageV1) SetCdlPreviousEventIdList(v []String) { + o.CdlPreviousEventIdList = v +} + +func (o EventLineageV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventLineageV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cdl:EventId"] = o.CdlEventId + toSerialize["cdl:LineageId"] = o.CdlLineageId + toSerialize["cdl:DataModelMode"] = o.CdlDataModelMode + toSerialize["cdl:DataModelVersion"] = o.CdlDataModelVersion + toSerialize["cdl:DataRegistrationTimeStamp"] = o.CdlDataRegistrationTimeStamp + toSerialize["cdl:NextEventIdList"] = o.CdlNextEventIdList + toSerialize["cdl:PreviousEventIdList"] = o.CdlPreviousEventIdList + return toSerialize, nil +} + +type NullableEventLineageV1 struct { + value *EventLineageV1 + isSet bool +} + +func (v NullableEventLineageV1) Get() *EventLineageV1 { + return v.value +} + +func (v *NullableEventLineageV1) Set(val *EventLineageV1) { + v.value = val + v.isSet = true +} + +func (v NullableEventLineageV1) IsSet() bool { + return v.isSet +} + +func (v *NullableEventLineageV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventLineageV1(val *EventLineageV1) *NullableEventLineageV1 { + return &NullableEventLineageV1{value: val, isSet: true} +} + +func (v NullableEventLineageV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventLineageV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_gateway_configuration_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_gateway_configuration_v1.go new file mode 100644 index 00000000000..2e529dde9db --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_gateway_configuration_v1.go @@ -0,0 +1,270 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the GatewayConfigurationV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GatewayConfigurationV1{} + +// GatewayConfigurationV1 struct for GatewayConfigurationV1 +type GatewayConfigurationV1 struct { + // Gateway URL + Url string `json:"url"` + // Value of User-Agent header sent to CDL (to identify this client) + UserAgent *string `json:"userAgent,omitempty"` + // Set to true to ignore self-signed and other rejected certificates + SkipCertCheck *bool `json:"skipCertCheck,omitempty"` + // CA of CDL API gateway server in PEM format to use + CaPath *string `json:"caPath,omitempty"` + // Overwrite server name from cdlApiGateway.url to match one specified in CA + ServerName *string `json:"serverName,omitempty"` +} + +// NewGatewayConfigurationV1 instantiates a new GatewayConfigurationV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGatewayConfigurationV1(url string) *GatewayConfigurationV1 { + this := GatewayConfigurationV1{} + this.Url = url + var skipCertCheck bool = false + this.SkipCertCheck = &skipCertCheck + return &this +} + +// NewGatewayConfigurationV1WithDefaults instantiates a new GatewayConfigurationV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGatewayConfigurationV1WithDefaults() *GatewayConfigurationV1 { + this := GatewayConfigurationV1{} + var skipCertCheck bool = false + this.SkipCertCheck = &skipCertCheck + return &this +} + +// GetUrl returns the Url field value +func (o *GatewayConfigurationV1) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *GatewayConfigurationV1) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *GatewayConfigurationV1) SetUrl(v string) { + o.Url = v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *GatewayConfigurationV1) GetUserAgent() string { + if o == nil || isNil(o.UserAgent) { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayConfigurationV1) GetUserAgentOk() (*string, bool) { + if o == nil || isNil(o.UserAgent) { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *GatewayConfigurationV1) HasUserAgent() bool { + if o != nil && !isNil(o.UserAgent) { + return true + } + + return false +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *GatewayConfigurationV1) SetUserAgent(v string) { + o.UserAgent = &v +} + +// GetSkipCertCheck returns the SkipCertCheck field value if set, zero value otherwise. +func (o *GatewayConfigurationV1) GetSkipCertCheck() bool { + if o == nil || isNil(o.SkipCertCheck) { + var ret bool + return ret + } + return *o.SkipCertCheck +} + +// GetSkipCertCheckOk returns a tuple with the SkipCertCheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayConfigurationV1) GetSkipCertCheckOk() (*bool, bool) { + if o == nil || isNil(o.SkipCertCheck) { + return nil, false + } + return o.SkipCertCheck, true +} + +// HasSkipCertCheck returns a boolean if a field has been set. +func (o *GatewayConfigurationV1) HasSkipCertCheck() bool { + if o != nil && !isNil(o.SkipCertCheck) { + return true + } + + return false +} + +// SetSkipCertCheck gets a reference to the given bool and assigns it to the SkipCertCheck field. +func (o *GatewayConfigurationV1) SetSkipCertCheck(v bool) { + o.SkipCertCheck = &v +} + +// GetCaPath returns the CaPath field value if set, zero value otherwise. +func (o *GatewayConfigurationV1) GetCaPath() string { + if o == nil || isNil(o.CaPath) { + var ret string + return ret + } + return *o.CaPath +} + +// GetCaPathOk returns a tuple with the CaPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayConfigurationV1) GetCaPathOk() (*string, bool) { + if o == nil || isNil(o.CaPath) { + return nil, false + } + return o.CaPath, true +} + +// HasCaPath returns a boolean if a field has been set. +func (o *GatewayConfigurationV1) HasCaPath() bool { + if o != nil && !isNil(o.CaPath) { + return true + } + + return false +} + +// SetCaPath gets a reference to the given string and assigns it to the CaPath field. +func (o *GatewayConfigurationV1) SetCaPath(v string) { + o.CaPath = &v +} + +// GetServerName returns the ServerName field value if set, zero value otherwise. +func (o *GatewayConfigurationV1) GetServerName() string { + if o == nil || isNil(o.ServerName) { + var ret string + return ret + } + return *o.ServerName +} + +// GetServerNameOk returns a tuple with the ServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GatewayConfigurationV1) GetServerNameOk() (*string, bool) { + if o == nil || isNil(o.ServerName) { + return nil, false + } + return o.ServerName, true +} + +// HasServerName returns a boolean if a field has been set. +func (o *GatewayConfigurationV1) HasServerName() bool { + if o != nil && !isNil(o.ServerName) { + return true + } + + return false +} + +// SetServerName gets a reference to the given string and assigns it to the ServerName field. +func (o *GatewayConfigurationV1) SetServerName(v string) { + o.ServerName = &v +} + +func (o GatewayConfigurationV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GatewayConfigurationV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + if !isNil(o.UserAgent) { + toSerialize["userAgent"] = o.UserAgent + } + if !isNil(o.SkipCertCheck) { + toSerialize["skipCertCheck"] = o.SkipCertCheck + } + if !isNil(o.CaPath) { + toSerialize["caPath"] = o.CaPath + } + if !isNil(o.ServerName) { + toSerialize["serverName"] = o.ServerName + } + return toSerialize, nil +} + +type NullableGatewayConfigurationV1 struct { + value *GatewayConfigurationV1 + isSet bool +} + +func (v NullableGatewayConfigurationV1) Get() *GatewayConfigurationV1 { + return v.value +} + +func (v *NullableGatewayConfigurationV1) Set(val *GatewayConfigurationV1) { + v.value = val + v.isSet = true +} + +func (v NullableGatewayConfigurationV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGatewayConfigurationV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGatewayConfigurationV1(val *GatewayConfigurationV1) *NullableGatewayConfigurationV1 { + return &NullableGatewayConfigurationV1{value: val, isSet: true} +} + +func (v NullableGatewayConfigurationV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGatewayConfigurationV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_option_direction_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_option_direction_v1.go new file mode 100644 index 00000000000..dbc3454f93f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_option_direction_v1.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" + "fmt" +) + +// GetLineageOptionDirectionV1 the model 'GetLineageOptionDirectionV1' +type GetLineageOptionDirectionV1 string + +// List of GetLineageOptionDirectionV1 +const ( + Backward GetLineageOptionDirectionV1 = "backward" + Forward GetLineageOptionDirectionV1 = "forward" + Both GetLineageOptionDirectionV1 = "both" +) + +// All allowed values of GetLineageOptionDirectionV1 enum +var AllowedGetLineageOptionDirectionV1EnumValues = []GetLineageOptionDirectionV1{ + "backward", + "forward", + "both", +} + +func (v *GetLineageOptionDirectionV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetLineageOptionDirectionV1(value) + for _, existing := range AllowedGetLineageOptionDirectionV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GetLineageOptionDirectionV1", value) +} + +// NewGetLineageOptionDirectionV1FromValue returns a pointer to a valid GetLineageOptionDirectionV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetLineageOptionDirectionV1FromValue(v string) (*GetLineageOptionDirectionV1, error) { + ev := GetLineageOptionDirectionV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetLineageOptionDirectionV1: valid values are %v", v, AllowedGetLineageOptionDirectionV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetLineageOptionDirectionV1) IsValid() bool { + for _, existing := range AllowedGetLineageOptionDirectionV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetLineageOptionDirectionV1 value +func (v GetLineageOptionDirectionV1) Ptr() *GetLineageOptionDirectionV1 { + return &v +} + +type NullableGetLineageOptionDirectionV1 struct { + value *GetLineageOptionDirectionV1 + isSet bool +} + +func (v NullableGetLineageOptionDirectionV1) Get() *GetLineageOptionDirectionV1 { + return v.value +} + +func (v *NullableGetLineageOptionDirectionV1) Set(val *GetLineageOptionDirectionV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetLineageOptionDirectionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLineageOptionDirectionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLineageOptionDirectionV1(val *GetLineageOptionDirectionV1) *NullableGetLineageOptionDirectionV1 { + return &NullableGetLineageOptionDirectionV1{value: val, isSet: true} +} + +func (v NullableGetLineageOptionDirectionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLineageOptionDirectionV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_request_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_request_v1.go new file mode 100644 index 00000000000..95fdb4003e5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_request_v1.go @@ -0,0 +1,220 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the GetLineageRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLineageRequestV1{} + +// GetLineageRequestV1 struct for GetLineageRequestV1 +type GetLineageRequestV1 struct { + AuthInfo AuthInfoV1 `json:"authInfo"` + EventId string `json:"eventId"` + Direction *GetLineageOptionDirectionV1 `json:"direction,omitempty"` + Depth *string `json:"depth,omitempty"` +} + +// NewGetLineageRequestV1 instantiates a new GetLineageRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetLineageRequestV1(authInfo AuthInfoV1, eventId string) *GetLineageRequestV1 { + this := GetLineageRequestV1{} + this.AuthInfo = authInfo + this.EventId = eventId + var depth string = "-1" + this.Depth = &depth + return &this +} + +// NewGetLineageRequestV1WithDefaults instantiates a new GetLineageRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetLineageRequestV1WithDefaults() *GetLineageRequestV1 { + this := GetLineageRequestV1{} + var depth string = "-1" + this.Depth = &depth + return &this +} + +// GetAuthInfo returns the AuthInfo field value +func (o *GetLineageRequestV1) GetAuthInfo() AuthInfoV1 { + if o == nil { + var ret AuthInfoV1 + return ret + } + + return o.AuthInfo +} + +// GetAuthInfoOk returns a tuple with the AuthInfo field value +// and a boolean to check if the value has been set. +func (o *GetLineageRequestV1) GetAuthInfoOk() (*AuthInfoV1, bool) { + if o == nil { + return nil, false + } + return &o.AuthInfo, true +} + +// SetAuthInfo sets field value +func (o *GetLineageRequestV1) SetAuthInfo(v AuthInfoV1) { + o.AuthInfo = v +} + +// GetEventId returns the EventId field value +func (o *GetLineageRequestV1) GetEventId() string { + if o == nil { + var ret string + return ret + } + + return o.EventId +} + +// GetEventIdOk returns a tuple with the EventId field value +// and a boolean to check if the value has been set. +func (o *GetLineageRequestV1) GetEventIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EventId, true +} + +// SetEventId sets field value +func (o *GetLineageRequestV1) SetEventId(v string) { + o.EventId = v +} + +// GetDirection returns the Direction field value if set, zero value otherwise. +func (o *GetLineageRequestV1) GetDirection() GetLineageOptionDirectionV1 { + if o == nil || isNil(o.Direction) { + var ret GetLineageOptionDirectionV1 + return ret + } + return *o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLineageRequestV1) GetDirectionOk() (*GetLineageOptionDirectionV1, bool) { + if o == nil || isNil(o.Direction) { + return nil, false + } + return o.Direction, true +} + +// HasDirection returns a boolean if a field has been set. +func (o *GetLineageRequestV1) HasDirection() bool { + if o != nil && !isNil(o.Direction) { + return true + } + + return false +} + +// SetDirection gets a reference to the given GetLineageOptionDirectionV1 and assigns it to the Direction field. +func (o *GetLineageRequestV1) SetDirection(v GetLineageOptionDirectionV1) { + o.Direction = &v +} + +// GetDepth returns the Depth field value if set, zero value otherwise. +func (o *GetLineageRequestV1) GetDepth() string { + if o == nil || isNil(o.Depth) { + var ret string + return ret + } + return *o.Depth +} + +// GetDepthOk returns a tuple with the Depth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLineageRequestV1) GetDepthOk() (*string, bool) { + if o == nil || isNil(o.Depth) { + return nil, false + } + return o.Depth, true +} + +// HasDepth returns a boolean if a field has been set. +func (o *GetLineageRequestV1) HasDepth() bool { + if o != nil && !isNil(o.Depth) { + return true + } + + return false +} + +// SetDepth gets a reference to the given string and assigns it to the Depth field. +func (o *GetLineageRequestV1) SetDepth(v string) { + o.Depth = &v +} + +func (o GetLineageRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLineageRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authInfo"] = o.AuthInfo + toSerialize["eventId"] = o.EventId + if !isNil(o.Direction) { + toSerialize["direction"] = o.Direction + } + if !isNil(o.Depth) { + toSerialize["depth"] = o.Depth + } + return toSerialize, nil +} + +type NullableGetLineageRequestV1 struct { + value *GetLineageRequestV1 + isSet bool +} + +func (v NullableGetLineageRequestV1) Get() *GetLineageRequestV1 { + return v.value +} + +func (v *NullableGetLineageRequestV1) Set(val *GetLineageRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetLineageRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLineageRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLineageRequestV1(val *GetLineageRequestV1) *NullableGetLineageRequestV1 { + return &NullableGetLineageRequestV1{value: val, isSet: true} +} + +func (v NullableGetLineageRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLineageRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_response_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_response_v1.go new file mode 100644 index 00000000000..409ac1ef393 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_get_lineage_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the GetLineageResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLineageResponseV1{} + +// GetLineageResponseV1 struct for GetLineageResponseV1 +type GetLineageResponseV1 struct { + Detail []TrailEventDetailsV1 `json:"detail"` + Result String `json:"result"` +} + +// NewGetLineageResponseV1 instantiates a new GetLineageResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetLineageResponseV1(detail []TrailEventDetailsV1, result String) *GetLineageResponseV1 { + this := GetLineageResponseV1{} + this.Detail = detail + this.Result = result + return &this +} + +// NewGetLineageResponseV1WithDefaults instantiates a new GetLineageResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetLineageResponseV1WithDefaults() *GetLineageResponseV1 { + this := GetLineageResponseV1{} + return &this +} + +// GetDetail returns the Detail field value +func (o *GetLineageResponseV1) GetDetail() []TrailEventDetailsV1 { + if o == nil { + var ret []TrailEventDetailsV1 + return ret + } + + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value +// and a boolean to check if the value has been set. +func (o *GetLineageResponseV1) GetDetailOk() ([]TrailEventDetailsV1, bool) { + if o == nil { + return nil, false + } + return o.Detail, true +} + +// SetDetail sets field value +func (o *GetLineageResponseV1) SetDetail(v []TrailEventDetailsV1) { + o.Detail = v +} + +// GetResult returns the Result field value +func (o *GetLineageResponseV1) GetResult() String { + if o == nil { + var ret String + return ret + } + + return o.Result +} + +// GetResultOk returns a tuple with the Result field value +// and a boolean to check if the value has been set. +func (o *GetLineageResponseV1) GetResultOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.Result, true +} + +// SetResult sets field value +func (o *GetLineageResponseV1) SetResult(v String) { + o.Result = v +} + +func (o GetLineageResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLineageResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["detail"] = o.Detail + toSerialize["result"] = o.Result + return toSerialize, nil +} + +type NullableGetLineageResponseV1 struct { + value *GetLineageResponseV1 + isSet bool +} + +func (v NullableGetLineageResponseV1) Get() *GetLineageResponseV1 { + return v.value +} + +func (v *NullableGetLineageResponseV1) Set(val *GetLineageResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetLineageResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLineageResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLineageResponseV1(val *GetLineageResponseV1) *NullableGetLineageResponseV1 { + return &NullableGetLineageResponseV1{value: val, isSet: true} +} + +func (v NullableGetLineageResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLineageResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_request_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_request_v1.go new file mode 100644 index 00000000000..f91ed0a6498 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_request_v1.go @@ -0,0 +1,263 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the RegisterHistoryDataRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegisterHistoryDataRequestV1{} + +// RegisterHistoryDataRequestV1 struct for RegisterHistoryDataRequestV1 +type RegisterHistoryDataRequestV1 struct { + AuthInfo AuthInfoV1 `json:"authInfo"` + EventId *string `json:"eventId,omitempty"` + LineageId *string `json:"lineageId,omitempty"` + Tags interface{} `json:"tags,omitempty"` + Properties interface{} `json:"properties,omitempty"` +} + +// NewRegisterHistoryDataRequestV1 instantiates a new RegisterHistoryDataRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegisterHistoryDataRequestV1(authInfo AuthInfoV1) *RegisterHistoryDataRequestV1 { + this := RegisterHistoryDataRequestV1{} + this.AuthInfo = authInfo + return &this +} + +// NewRegisterHistoryDataRequestV1WithDefaults instantiates a new RegisterHistoryDataRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegisterHistoryDataRequestV1WithDefaults() *RegisterHistoryDataRequestV1 { + this := RegisterHistoryDataRequestV1{} + return &this +} + +// GetAuthInfo returns the AuthInfo field value +func (o *RegisterHistoryDataRequestV1) GetAuthInfo() AuthInfoV1 { + if o == nil { + var ret AuthInfoV1 + return ret + } + + return o.AuthInfo +} + +// GetAuthInfoOk returns a tuple with the AuthInfo field value +// and a boolean to check if the value has been set. +func (o *RegisterHistoryDataRequestV1) GetAuthInfoOk() (*AuthInfoV1, bool) { + if o == nil { + return nil, false + } + return &o.AuthInfo, true +} + +// SetAuthInfo sets field value +func (o *RegisterHistoryDataRequestV1) SetAuthInfo(v AuthInfoV1) { + o.AuthInfo = v +} + +// GetEventId returns the EventId field value if set, zero value otherwise. +func (o *RegisterHistoryDataRequestV1) GetEventId() string { + if o == nil || isNil(o.EventId) { + var ret string + return ret + } + return *o.EventId +} + +// GetEventIdOk returns a tuple with the EventId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegisterHistoryDataRequestV1) GetEventIdOk() (*string, bool) { + if o == nil || isNil(o.EventId) { + return nil, false + } + return o.EventId, true +} + +// HasEventId returns a boolean if a field has been set. +func (o *RegisterHistoryDataRequestV1) HasEventId() bool { + if o != nil && !isNil(o.EventId) { + return true + } + + return false +} + +// SetEventId gets a reference to the given string and assigns it to the EventId field. +func (o *RegisterHistoryDataRequestV1) SetEventId(v string) { + o.EventId = &v +} + +// GetLineageId returns the LineageId field value if set, zero value otherwise. +func (o *RegisterHistoryDataRequestV1) GetLineageId() string { + if o == nil || isNil(o.LineageId) { + var ret string + return ret + } + return *o.LineageId +} + +// GetLineageIdOk returns a tuple with the LineageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegisterHistoryDataRequestV1) GetLineageIdOk() (*string, bool) { + if o == nil || isNil(o.LineageId) { + return nil, false + } + return o.LineageId, true +} + +// HasLineageId returns a boolean if a field has been set. +func (o *RegisterHistoryDataRequestV1) HasLineageId() bool { + if o != nil && !isNil(o.LineageId) { + return true + } + + return false +} + +// SetLineageId gets a reference to the given string and assigns it to the LineageId field. +func (o *RegisterHistoryDataRequestV1) SetLineageId(v string) { + o.LineageId = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RegisterHistoryDataRequestV1) GetTags() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags 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 *RegisterHistoryDataRequestV1) GetTagsOk() (*interface{}, bool) { + if o == nil || isNil(o.Tags) { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *RegisterHistoryDataRequestV1) HasTags() bool { + if o != nil && isNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given interface{} and assigns it to the Tags field. +func (o *RegisterHistoryDataRequestV1) SetTags(v interface{}) { + o.Tags = v +} + +// GetProperties returns the Properties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RegisterHistoryDataRequestV1) GetProperties() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties 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 *RegisterHistoryDataRequestV1) GetPropertiesOk() (*interface{}, bool) { + if o == nil || isNil(o.Properties) { + return nil, false + } + return &o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *RegisterHistoryDataRequestV1) HasProperties() bool { + if o != nil && isNil(o.Properties) { + return true + } + + return false +} + +// SetProperties gets a reference to the given interface{} and assigns it to the Properties field. +func (o *RegisterHistoryDataRequestV1) SetProperties(v interface{}) { + o.Properties = v +} + +func (o RegisterHistoryDataRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegisterHistoryDataRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authInfo"] = o.AuthInfo + if !isNil(o.EventId) { + toSerialize["eventId"] = o.EventId + } + if !isNil(o.LineageId) { + toSerialize["lineageId"] = o.LineageId + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + return toSerialize, nil +} + +type NullableRegisterHistoryDataRequestV1 struct { + value *RegisterHistoryDataRequestV1 + isSet bool +} + +func (v NullableRegisterHistoryDataRequestV1) Get() *RegisterHistoryDataRequestV1 { + return v.value +} + +func (v *NullableRegisterHistoryDataRequestV1) Set(val *RegisterHistoryDataRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableRegisterHistoryDataRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableRegisterHistoryDataRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegisterHistoryDataRequestV1(val *RegisterHistoryDataRequestV1) *NullableRegisterHistoryDataRequestV1 { + return &NullableRegisterHistoryDataRequestV1{value: val, isSet: true} +} + +func (v NullableRegisterHistoryDataRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegisterHistoryDataRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_v1_response.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_v1_response.go new file mode 100644 index 00000000000..415e123d360 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_register_history_data_v1_response.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the RegisterHistoryDataV1Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegisterHistoryDataV1Response{} + +// RegisterHistoryDataV1Response struct for RegisterHistoryDataV1Response +type RegisterHistoryDataV1Response struct { + Detail TrailEventDetailsV1 `json:"detail"` + Result String `json:"result"` +} + +// NewRegisterHistoryDataV1Response instantiates a new RegisterHistoryDataV1Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegisterHistoryDataV1Response(detail TrailEventDetailsV1, result String) *RegisterHistoryDataV1Response { + this := RegisterHistoryDataV1Response{} + this.Detail = detail + this.Result = result + return &this +} + +// NewRegisterHistoryDataV1ResponseWithDefaults instantiates a new RegisterHistoryDataV1Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegisterHistoryDataV1ResponseWithDefaults() *RegisterHistoryDataV1Response { + this := RegisterHistoryDataV1Response{} + return &this +} + +// GetDetail returns the Detail field value +func (o *RegisterHistoryDataV1Response) GetDetail() TrailEventDetailsV1 { + if o == nil { + var ret TrailEventDetailsV1 + return ret + } + + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value +// and a boolean to check if the value has been set. +func (o *RegisterHistoryDataV1Response) GetDetailOk() (*TrailEventDetailsV1, bool) { + if o == nil { + return nil, false + } + return &o.Detail, true +} + +// SetDetail sets field value +func (o *RegisterHistoryDataV1Response) SetDetail(v TrailEventDetailsV1) { + o.Detail = v +} + +// GetResult returns the Result field value +func (o *RegisterHistoryDataV1Response) GetResult() String { + if o == nil { + var ret String + return ret + } + + return o.Result +} + +// GetResultOk returns a tuple with the Result field value +// and a boolean to check if the value has been set. +func (o *RegisterHistoryDataV1Response) GetResultOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.Result, true +} + +// SetResult sets field value +func (o *RegisterHistoryDataV1Response) SetResult(v String) { + o.Result = v +} + +func (o RegisterHistoryDataV1Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegisterHistoryDataV1Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["detail"] = o.Detail + toSerialize["result"] = o.Result + return toSerialize, nil +} + +type NullableRegisterHistoryDataV1Response struct { + value *RegisterHistoryDataV1Response + isSet bool +} + +func (v NullableRegisterHistoryDataV1Response) Get() *RegisterHistoryDataV1Response { + return v.value +} + +func (v *NullableRegisterHistoryDataV1Response) Set(val *RegisterHistoryDataV1Response) { + v.value = val + v.isSet = true +} + +func (v NullableRegisterHistoryDataV1Response) IsSet() bool { + return v.isSet +} + +func (v *NullableRegisterHistoryDataV1Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegisterHistoryDataV1Response(val *RegisterHistoryDataV1Response) *NullableRegisterHistoryDataV1Response { + return &NullableRegisterHistoryDataV1Response{value: val, isSet: true} +} + +func (v NullableRegisterHistoryDataV1Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegisterHistoryDataV1Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_request_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_request_v1.go new file mode 100644 index 00000000000..5c8088afd53 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_request_v1.go @@ -0,0 +1,175 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the SearchLineageRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchLineageRequestV1{} + +// SearchLineageRequestV1 struct for SearchLineageRequestV1 +type SearchLineageRequestV1 struct { + AuthInfo AuthInfoV1 `json:"authInfo"` + SearchType SearchLineageTypeV1 `json:"searchType"` + Fields interface{} `json:"fields"` +} + +// NewSearchLineageRequestV1 instantiates a new SearchLineageRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSearchLineageRequestV1(authInfo AuthInfoV1, searchType SearchLineageTypeV1, fields interface{}) *SearchLineageRequestV1 { + this := SearchLineageRequestV1{} + this.AuthInfo = authInfo + this.SearchType = searchType + this.Fields = fields + return &this +} + +// NewSearchLineageRequestV1WithDefaults instantiates a new SearchLineageRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSearchLineageRequestV1WithDefaults() *SearchLineageRequestV1 { + this := SearchLineageRequestV1{} + return &this +} + +// GetAuthInfo returns the AuthInfo field value +func (o *SearchLineageRequestV1) GetAuthInfo() AuthInfoV1 { + if o == nil { + var ret AuthInfoV1 + return ret + } + + return o.AuthInfo +} + +// GetAuthInfoOk returns a tuple with the AuthInfo field value +// and a boolean to check if the value has been set. +func (o *SearchLineageRequestV1) GetAuthInfoOk() (*AuthInfoV1, bool) { + if o == nil { + return nil, false + } + return &o.AuthInfo, true +} + +// SetAuthInfo sets field value +func (o *SearchLineageRequestV1) SetAuthInfo(v AuthInfoV1) { + o.AuthInfo = v +} + +// GetSearchType returns the SearchType field value +func (o *SearchLineageRequestV1) GetSearchType() SearchLineageTypeV1 { + if o == nil { + var ret SearchLineageTypeV1 + return ret + } + + return o.SearchType +} + +// GetSearchTypeOk returns a tuple with the SearchType field value +// and a boolean to check if the value has been set. +func (o *SearchLineageRequestV1) GetSearchTypeOk() (*SearchLineageTypeV1, bool) { + if o == nil { + return nil, false + } + return &o.SearchType, true +} + +// SetSearchType sets field value +func (o *SearchLineageRequestV1) SetSearchType(v SearchLineageTypeV1) { + o.SearchType = v +} + +// GetFields returns the Fields field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *SearchLineageRequestV1) GetFields() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.Fields +} + +// GetFieldsOk returns a tuple with the Fields 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 *SearchLineageRequestV1) GetFieldsOk() (*interface{}, bool) { + if o == nil || isNil(o.Fields) { + return nil, false + } + return &o.Fields, true +} + +// SetFields sets field value +func (o *SearchLineageRequestV1) SetFields(v interface{}) { + o.Fields = v +} + +func (o SearchLineageRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchLineageRequestV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authInfo"] = o.AuthInfo + toSerialize["searchType"] = o.SearchType + if o.Fields != nil { + toSerialize["fields"] = o.Fields + } + return toSerialize, nil +} + +type NullableSearchLineageRequestV1 struct { + value *SearchLineageRequestV1 + isSet bool +} + +func (v NullableSearchLineageRequestV1) Get() *SearchLineageRequestV1 { + return v.value +} + +func (v *NullableSearchLineageRequestV1) Set(val *SearchLineageRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableSearchLineageRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchLineageRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchLineageRequestV1(val *SearchLineageRequestV1) *NullableSearchLineageRequestV1 { + return &NullableSearchLineageRequestV1{value: val, isSet: true} +} + +func (v NullableSearchLineageRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchLineageRequestV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_response_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_response_v1.go new file mode 100644 index 00000000000..26a9335441c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the SearchLineageResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchLineageResponseV1{} + +// SearchLineageResponseV1 struct for SearchLineageResponseV1 +type SearchLineageResponseV1 struct { + Detail []TrailEventDetailsV1 `json:"detail"` + Result String `json:"result"` +} + +// NewSearchLineageResponseV1 instantiates a new SearchLineageResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSearchLineageResponseV1(detail []TrailEventDetailsV1, result String) *SearchLineageResponseV1 { + this := SearchLineageResponseV1{} + this.Detail = detail + this.Result = result + return &this +} + +// NewSearchLineageResponseV1WithDefaults instantiates a new SearchLineageResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSearchLineageResponseV1WithDefaults() *SearchLineageResponseV1 { + this := SearchLineageResponseV1{} + return &this +} + +// GetDetail returns the Detail field value +func (o *SearchLineageResponseV1) GetDetail() []TrailEventDetailsV1 { + if o == nil { + var ret []TrailEventDetailsV1 + return ret + } + + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value +// and a boolean to check if the value has been set. +func (o *SearchLineageResponseV1) GetDetailOk() ([]TrailEventDetailsV1, bool) { + if o == nil { + return nil, false + } + return o.Detail, true +} + +// SetDetail sets field value +func (o *SearchLineageResponseV1) SetDetail(v []TrailEventDetailsV1) { + o.Detail = v +} + +// GetResult returns the Result field value +func (o *SearchLineageResponseV1) GetResult() String { + if o == nil { + var ret String + return ret + } + + return o.Result +} + +// GetResultOk returns a tuple with the Result field value +// and a boolean to check if the value has been set. +func (o *SearchLineageResponseV1) GetResultOk() (*String, bool) { + if o == nil { + return nil, false + } + return &o.Result, true +} + +// SetResult sets field value +func (o *SearchLineageResponseV1) SetResult(v String) { + o.Result = v +} + +func (o SearchLineageResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchLineageResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["detail"] = o.Detail + toSerialize["result"] = o.Result + return toSerialize, nil +} + +type NullableSearchLineageResponseV1 struct { + value *SearchLineageResponseV1 + isSet bool +} + +func (v NullableSearchLineageResponseV1) Get() *SearchLineageResponseV1 { + return v.value +} + +func (v *NullableSearchLineageResponseV1) Set(val *SearchLineageResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableSearchLineageResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchLineageResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchLineageResponseV1(val *SearchLineageResponseV1) *NullableSearchLineageResponseV1 { + return &NullableSearchLineageResponseV1{value: val, isSet: true} +} + +func (v NullableSearchLineageResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchLineageResponseV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_type_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_type_v1.go new file mode 100644 index 00000000000..e89ec80f71d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_search_lineage_type_v1.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" + "fmt" +) + +// SearchLineageTypeV1 the model 'SearchLineageTypeV1' +type SearchLineageTypeV1 string + +// List of SearchLineageTypeV1 +const ( + ExactMatch SearchLineageTypeV1 = "exactmatch" + PartialMatch SearchLineageTypeV1 = "partialmatch" + RegexMatch SearchLineageTypeV1 = "regexpmatch" +) + +// All allowed values of SearchLineageTypeV1 enum +var AllowedSearchLineageTypeV1EnumValues = []SearchLineageTypeV1{ + "exactmatch", + "partialmatch", + "regexpmatch", +} + +func (v *SearchLineageTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SearchLineageTypeV1(value) + for _, existing := range AllowedSearchLineageTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SearchLineageTypeV1", value) +} + +// NewSearchLineageTypeV1FromValue returns a pointer to a valid SearchLineageTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSearchLineageTypeV1FromValue(v string) (*SearchLineageTypeV1, error) { + ev := SearchLineageTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SearchLineageTypeV1: valid values are %v", v, AllowedSearchLineageTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SearchLineageTypeV1) IsValid() bool { + for _, existing := range AllowedSearchLineageTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SearchLineageTypeV1 value +func (v SearchLineageTypeV1) Ptr() *SearchLineageTypeV1 { + return &v +} + +type NullableSearchLineageTypeV1 struct { + value *SearchLineageTypeV1 + isSet bool +} + +func (v NullableSearchLineageTypeV1) Get() *SearchLineageTypeV1 { + return v.value +} + +func (v *NullableSearchLineageTypeV1) Set(val *SearchLineageTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableSearchLineageTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchLineageTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchLineageTypeV1(val *SearchLineageTypeV1) *NullableSearchLineageTypeV1 { + return &NullableSearchLineageTypeV1{value: val, isSet: true} +} + +func (v NullableSearchLineageTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchLineageTypeV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_trail_event_details_v1.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_trail_event_details_v1.go new file mode 100644 index 00000000000..e6a99541d0a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/model_trail_event_details_v1.go @@ -0,0 +1,216 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +import ( + "encoding/json" +) + +// checks if the TrailEventDetailsV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TrailEventDetailsV1{} + +// TrailEventDetailsV1 Details of newly created CDL event. +type TrailEventDetailsV1 struct { + CdlEvent interface{} `json:"cdl:Event,omitempty"` + CdlLineage EventLineageV1 `json:"cdl:Lineage"` + CdlTags interface{} `json:"cdl:Tags"` + CdlVerification interface{} `json:"cdl:Verification"` +} + +// NewTrailEventDetailsV1 instantiates a new TrailEventDetailsV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTrailEventDetailsV1(cdlLineage EventLineageV1, cdlTags interface{}, cdlVerification interface{}) *TrailEventDetailsV1 { + this := TrailEventDetailsV1{} + this.CdlLineage = cdlLineage + this.CdlTags = cdlTags + this.CdlVerification = cdlVerification + return &this +} + +// NewTrailEventDetailsV1WithDefaults instantiates a new TrailEventDetailsV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTrailEventDetailsV1WithDefaults() *TrailEventDetailsV1 { + this := TrailEventDetailsV1{} + return &this +} + +// GetCdlEvent returns the CdlEvent field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TrailEventDetailsV1) GetCdlEvent() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.CdlEvent +} + +// GetCdlEventOk returns a tuple with the CdlEvent 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 *TrailEventDetailsV1) GetCdlEventOk() (*interface{}, bool) { + if o == nil || isNil(o.CdlEvent) { + return nil, false + } + return &o.CdlEvent, true +} + +// HasCdlEvent returns a boolean if a field has been set. +func (o *TrailEventDetailsV1) HasCdlEvent() bool { + if o != nil && isNil(o.CdlEvent) { + return true + } + + return false +} + +// SetCdlEvent gets a reference to the given interface{} and assigns it to the CdlEvent field. +func (o *TrailEventDetailsV1) SetCdlEvent(v interface{}) { + o.CdlEvent = v +} + +// GetCdlLineage returns the CdlLineage field value +func (o *TrailEventDetailsV1) GetCdlLineage() EventLineageV1 { + if o == nil { + var ret EventLineageV1 + return ret + } + + return o.CdlLineage +} + +// GetCdlLineageOk returns a tuple with the CdlLineage field value +// and a boolean to check if the value has been set. +func (o *TrailEventDetailsV1) GetCdlLineageOk() (*EventLineageV1, bool) { + if o == nil { + return nil, false + } + return &o.CdlLineage, true +} + +// SetCdlLineage sets field value +func (o *TrailEventDetailsV1) SetCdlLineage(v EventLineageV1) { + o.CdlLineage = v +} + +// GetCdlTags returns the CdlTags field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *TrailEventDetailsV1) GetCdlTags() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.CdlTags +} + +// GetCdlTagsOk returns a tuple with the CdlTags 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 *TrailEventDetailsV1) GetCdlTagsOk() (*interface{}, bool) { + if o == nil || isNil(o.CdlTags) { + return nil, false + } + return &o.CdlTags, true +} + +// SetCdlTags sets field value +func (o *TrailEventDetailsV1) SetCdlTags(v interface{}) { + o.CdlTags = v +} + +// GetCdlVerification returns the CdlVerification field value +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *TrailEventDetailsV1) GetCdlVerification() interface{} { + if o == nil { + var ret interface{} + return ret + } + + return o.CdlVerification +} + +// GetCdlVerificationOk returns a tuple with the CdlVerification 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 *TrailEventDetailsV1) GetCdlVerificationOk() (*interface{}, bool) { + if o == nil || isNil(o.CdlVerification) { + return nil, false + } + return &o.CdlVerification, true +} + +// SetCdlVerification sets field value +func (o *TrailEventDetailsV1) SetCdlVerification(v interface{}) { + o.CdlVerification = v +} + +func (o TrailEventDetailsV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TrailEventDetailsV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.CdlEvent != nil { + toSerialize["cdl:Event"] = o.CdlEvent + } + toSerialize["cdl:Lineage"] = o.CdlLineage + if o.CdlTags != nil { + toSerialize["cdl:Tags"] = o.CdlTags + } + if o.CdlVerification != nil { + toSerialize["cdl:Verification"] = o.CdlVerification + } + return toSerialize, nil +} + +type NullableTrailEventDetailsV1 struct { + value *TrailEventDetailsV1 + isSet bool +} + +func (v NullableTrailEventDetailsV1) Get() *TrailEventDetailsV1 { + return v.value +} + +func (v *NullableTrailEventDetailsV1) Set(val *TrailEventDetailsV1) { + v.value = val + v.isSet = true +} + +func (v NullableTrailEventDetailsV1) IsSet() bool { + return v.isSet +} + +func (v *NullableTrailEventDetailsV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTrailEventDetailsV1(val *TrailEventDetailsV1) *NullableTrailEventDetailsV1 { + return &NullableTrailEventDetailsV1{value: val, isSet: true} +} + +func (v NullableTrailEventDetailsV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTrailEventDetailsV1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..3132bc549d3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +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-cdl/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..085fedbbcba --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,73 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-cdl + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-cdl_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService GetLineageV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetLineageV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RegisterHistoryDataV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RegisterHistoryDataV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SearchLineageByGlobalDataV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SearchLineageByGlobalDataV1(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SearchLineageByHeaderV1", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SearchLineageByHeaderV1(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-cdl/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..803d4808aa4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-cdl/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cacti Plugin - Connector CDL + +Can perform basic tasks on Fujitsu CDL service. + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-cdl + +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/package.json b/packages/cactus-plugin-ledger-connector-corda/package.json index 0b47386b957..7ef521d7d21 100644 --- a/packages/cactus-plugin-ledger-connector-corda/package.json +++ b/packages/cactus-plugin-ledger-connector-corda/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "run-p generate-sdk generate-server", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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-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 --ignore-file-override ../../openapi-generator-ignore", 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..92ac54f5274 --- /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_vault_query_v1_request.go +model_x500_principal.go +response.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..1feade332be --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,157 @@ +# 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: 2.0.0-rc.3 +- 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 +*DefaultApi* | [**VaultQueryV1**](docs/DefaultApi.md#vaultqueryv1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/vault-query | + + +## 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) + - [VaultQueryV1Request](docs/VaultQueryV1Request.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..87197e2355c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1418 @@ +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 Cacti Plugin - Connector Corda + version: 2.0.0-rc.3 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/vault-query: + post: + description: Queryes the vault service for state references based on JVM class + names. Custom filters are not supported by this endpoint. + operationId: vaultQueryV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VaultQueryV1Request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VaultQueryV1Response' + description: OK + x-hyperledger-cactus: + http: + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/vault-query + verbLowerCase: post + /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: {} + 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 + VaultQueryV1Request: + additionalProperties: false + example: + contractStateType: contractStateType + properties: + contractStateType: + description: "Valid, fully qualified JVM class name which will be fed into\ + \ Class.forName(...)" + minLength: 1 + type: string + type: object + VaultQueryV1Response: + type: object + 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..294ce6fcaf0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,1188 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 +} + +type ApiVaultQueryV1Request struct { + ctx context.Context + ApiService *DefaultApiService + vaultQueryV1Request *VaultQueryV1Request +} + +func (r ApiVaultQueryV1Request) VaultQueryV1Request(vaultQueryV1Request VaultQueryV1Request) ApiVaultQueryV1Request { + r.vaultQueryV1Request = &vaultQueryV1Request + return r +} + +func (r ApiVaultQueryV1Request) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.VaultQueryV1Execute(r) +} + +/* +VaultQueryV1 Method for VaultQueryV1 + +Queryes the vault service for state references based on JVM class names. Custom filters are not supported by this endpoint. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiVaultQueryV1Request +*/ +func (a *DefaultApiService) VaultQueryV1(ctx context.Context) ApiVaultQueryV1Request { + return ApiVaultQueryV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return map[string]interface{} +func (a *DefaultApiService) VaultQueryV1Execute(r ApiVaultQueryV1Request) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.VaultQueryV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/vault-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.vaultQueryV1Request + 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..0d8d85f1171 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 Cacti Plugin - Connector Corda API v2.0.0-rc.3 +// 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..d9b35297548 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..c8a8f43a1b6 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..21b95d5a899 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..ade67ad6687 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..1ad0fe863b5 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..facb6ee98f7 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..78637250321 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..35eb33f1f76 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..58e0da57d94 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..20a4b33b688 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..581559db72a --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..e9fd7e0446d --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..490adc9daec --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..731ae5ceb89 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..c658138ce23 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..622533e96b4 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..e848979d590 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..b79010f3199 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..46c5c6c7402 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..1fb17540cdb --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..b47556b696c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_jvm_object.go @@ -0,0 +1,217 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 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 (both if not set or set to explicit null). +func (o *JvmObject) GetPrimitiveValue() interface{} { + if o == nil { + var ret 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. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *JvmObject) GetPrimitiveValueOk() (*interface{}, bool) { + if o == nil || IsNil(o.PrimitiveValue) { + return nil, 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 interface{} and assigns it to the PrimitiveValue field. +func (o *JvmObject) SetPrimitiveValue(v 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 o.PrimitiveValue != nil { + 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..a226c388fdd --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..9d94f25d930 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..dc435981f6f --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..9439af53c7c --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..b3b2c1e6ed5 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..d8d8afd7818 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..c8130c17ab4 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..dce7750a8c5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_party.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..591cd9b84d1 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..612e43aea8a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_sha256.go @@ -0,0 +1,171 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..7ffac1527e6 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..8524cbf139d --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..9e538c16086 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..30f1cf85fac --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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_vault_query_v1_request.go b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_vault_query_v1_request.go new file mode 100644 index 00000000000..c8a111c226e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/model_vault_query_v1_request.go @@ -0,0 +1,127 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-corda + +import ( + "encoding/json" +) + +// checks if the VaultQueryV1Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VaultQueryV1Request{} + +// VaultQueryV1Request struct for VaultQueryV1Request +type VaultQueryV1Request struct { + // Valid, fully qualified JVM class name which will be fed into Class.forName(...) + ContractStateType *string `json:"contractStateType,omitempty"` +} + +// NewVaultQueryV1Request instantiates a new VaultQueryV1Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVaultQueryV1Request() *VaultQueryV1Request { + this := VaultQueryV1Request{} + return &this +} + +// NewVaultQueryV1RequestWithDefaults instantiates a new VaultQueryV1Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVaultQueryV1RequestWithDefaults() *VaultQueryV1Request { + this := VaultQueryV1Request{} + return &this +} + +// GetContractStateType returns the ContractStateType field value if set, zero value otherwise. +func (o *VaultQueryV1Request) GetContractStateType() string { + if o == nil || IsNil(o.ContractStateType) { + var ret string + return ret + } + return *o.ContractStateType +} + +// GetContractStateTypeOk returns a tuple with the ContractStateType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VaultQueryV1Request) GetContractStateTypeOk() (*string, bool) { + if o == nil || IsNil(o.ContractStateType) { + return nil, false + } + return o.ContractStateType, true +} + +// HasContractStateType returns a boolean if a field has been set. +func (o *VaultQueryV1Request) HasContractStateType() bool { + if o != nil && !IsNil(o.ContractStateType) { + return true + } + + return false +} + +// SetContractStateType gets a reference to the given string and assigns it to the ContractStateType field. +func (o *VaultQueryV1Request) SetContractStateType(v string) { + o.ContractStateType = &v +} + +func (o VaultQueryV1Request) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VaultQueryV1Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContractStateType) { + toSerialize["contractStateType"] = o.ContractStateType + } + return toSerialize, nil +} + +type NullableVaultQueryV1Request struct { + value *VaultQueryV1Request + isSet bool +} + +func (v NullableVaultQueryV1Request) Get() *VaultQueryV1Request { + return v.value +} + +func (v *NullableVaultQueryV1Request) Set(val *VaultQueryV1Request) { + v.value = val + v.isSet = true +} + +func (v NullableVaultQueryV1Request) IsSet() bool { + return v.isSet +} + +func (v *NullableVaultQueryV1Request) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVaultQueryV1Request(val *VaultQueryV1Request) *NullableVaultQueryV1Request { + return &NullableVaultQueryV1Request{value: val, isSet: true} +} + +func (v NullableVaultQueryV1Request) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVaultQueryV1Request) 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..7ae1c51a0b7 --- /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 Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..6fc62efdd16 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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..58262a93624 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-corda/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cacti Plugin - Connector Corda + +Can perform basic tasks on a Corda ledger + +API version: 2.0.0-rc.3 +*/ + +// 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-ethereum/package.json b/packages/cactus-plugin-ledger-connector-ethereum/package.json index 907ad135467..2f2ffe6af11 100644 --- a/packages/cactus-plugin-ledger-connector-ethereum/package.json +++ b/packages/cactus-plugin-ledger-connector-ethereum/package.json @@ -53,10 +53,11 @@ ], "scripts": { "build:dev:backend:postbuild": "npm run copy-artillery-config", - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "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: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: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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", 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..4850eda0683 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/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_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 +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..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-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-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..100d827e1b8 --- /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: 2.0.0-rc.3 +- 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..41e7e6954ab --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,1013 @@ +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: 2.0.0-rc.3 +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: + default: false + description: "Include entire block data if flag is true, otherwise just\ + \ a header is returned (default)" + type: boolean + lastSeenBlock: + description: Block from which we want to start the monitoring process. + type: number + httpPollInterval: + description: How often to poll ethereum node for new blocks. Not used if + the node supports subscription based monitoring (i.e. WebSocket). + type: number + 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..7c082a56cc4 --- /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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-ethereum + +import ( + "bytes" + "context" + "io" + "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 := 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-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 := 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 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 := 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 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 := 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 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 := 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 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 := 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-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..07852bed56e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-ethereum/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: 2.0.0-rc.3 +*/ + +// 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" + "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 v2.0.0-rc.3 +// 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-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..7dd739b51d0 --- /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: 2.0.0-rc.3 +*/ + +// 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..614c6075bd3 --- /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.18 + +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..4c4b072d801 --- /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: 2.0.0-rc.3 +*/ + +// 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..e32a62c8ce0 --- /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: 2.0.0-rc.3 +*/ + +// 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..57d2bacf33e --- /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: 2.0.0-rc.3 +*/ + +// 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..d3bdbdc6f57 --- /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: 2.0.0-rc.3 +*/ + +// 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..fe440ea3a4e --- /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: 2.0.0-rc.3 +*/ + +// 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..01f0cf181b4 --- /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: 2.0.0-rc.3 +*/ + +// 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..48d5f37c737 --- /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: 2.0.0-rc.3 +*/ + +// 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..d2395cdcfaf --- /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: 2.0.0-rc.3 +*/ + +// 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..013c37ebc45 --- /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: 2.0.0-rc.3 +*/ + +// 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..99ea5083ac3 --- /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: 2.0.0-rc.3 +*/ + +// 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..274bdf3411e --- /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: 2.0.0-rc.3 +*/ + +// 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..82c313915eb --- /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: 2.0.0-rc.3 +*/ + +// 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..a8d5241b06b --- /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: 2.0.0-rc.3 +*/ + +// 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..c61cfcb1ee0 --- /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: 2.0.0-rc.3 +*/ + +// 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..2b5f46c76c3 --- /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: 2.0.0-rc.3 +*/ + +// 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..7c31a6aec68 --- /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: 2.0.0-rc.3 +*/ + +// 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..be13aeb9503 --- /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: 2.0.0-rc.3 +*/ + +// 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..eb1799c6974 --- /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: 2.0.0-rc.3 +*/ + +// 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..13c5ee6373d --- /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: 2.0.0-rc.3 +*/ + +// 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..c128b9f4bb7 --- /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: 2.0.0-rc.3 +*/ + +// 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..24f1c53ae98 --- /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: 2.0.0-rc.3 +*/ + +// 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..1dd14f5d932 --- /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: 2.0.0-rc.3 +*/ + +// 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..e9fafffbff7 --- /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: 2.0.0-rc.3 +*/ + +// 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..348b0208287 --- /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: 2.0.0-rc.3 +*/ + +// 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..f926bf65948 --- /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: 2.0.0-rc.3 +*/ + +// 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..2ef38f95983 --- /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,205 @@ +/* +Hyperledger Cacti Plugin - Connector Ethereum + +Can perform basic tasks on a Ethereum ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 { + // Include entire block data if flag is true, otherwise just a header is returned (default) + GetBlockData *bool `json:"getBlockData,omitempty"` + // Block from which we want to start the monitoring process. + LastSeenBlock *float32 `json:"lastSeenBlock,omitempty"` + // How often to poll ethereum node for new blocks. Not used if the node supports subscription based monitoring (i.e. WebSocket). + HttpPollInterval *float32 `json:"httpPollInterval,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{} + var getBlockData bool = false + this.GetBlockData = &getBlockData + 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{} + var getBlockData bool = false + this.GetBlockData = &getBlockData + 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 +} + +// GetLastSeenBlock returns the LastSeenBlock field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetLastSeenBlock() float32 { + if o == nil || IsNil(o.LastSeenBlock) { + var ret float32 + return ret + } + return *o.LastSeenBlock +} + +// GetLastSeenBlockOk returns a tuple with the LastSeenBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetLastSeenBlockOk() (*float32, bool) { + if o == nil || IsNil(o.LastSeenBlock) { + return nil, false + } + return o.LastSeenBlock, true +} + +// HasLastSeenBlock returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasLastSeenBlock() bool { + if o != nil && !IsNil(o.LastSeenBlock) { + return true + } + + return false +} + +// SetLastSeenBlock gets a reference to the given float32 and assigns it to the LastSeenBlock field. +func (o *WatchBlocksV1Options) SetLastSeenBlock(v float32) { + o.LastSeenBlock = &v +} + +// GetHttpPollInterval returns the HttpPollInterval field value if set, zero value otherwise. +func (o *WatchBlocksV1Options) GetHttpPollInterval() float32 { + if o == nil || IsNil(o.HttpPollInterval) { + var ret float32 + return ret + } + return *o.HttpPollInterval +} + +// GetHttpPollIntervalOk returns a tuple with the HttpPollInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WatchBlocksV1Options) GetHttpPollIntervalOk() (*float32, bool) { + if o == nil || IsNil(o.HttpPollInterval) { + return nil, false + } + return o.HttpPollInterval, true +} + +// HasHttpPollInterval returns a boolean if a field has been set. +func (o *WatchBlocksV1Options) HasHttpPollInterval() bool { + if o != nil && !IsNil(o.HttpPollInterval) { + return true + } + + return false +} + +// SetHttpPollInterval gets a reference to the given float32 and assigns it to the HttpPollInterval field. +func (o *WatchBlocksV1Options) SetHttpPollInterval(v float32) { + o.HttpPollInterval = &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 + } + if !IsNil(o.LastSeenBlock) { + toSerialize["lastSeenBlock"] = o.LastSeenBlock + } + if !IsNil(o.HttpPollInterval) { + toSerialize["httpPollInterval"] = o.HttpPollInterval + } + 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..9b8053ef04b --- /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: 2.0.0-rc.3 +*/ + +// 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..bc6dedce51e --- /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: 2.0.0-rc.3 +*/ + +// 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..63b85557a08 --- /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: 2.0.0-rc.3 +*/ + +// 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..2c39df3d746 --- /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: 2.0.0-rc.3 +*/ + +// 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..2024eb32179 --- /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: 2.0.0-rc.3 +*/ + +// 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..2541995a873 --- /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: 2.0.0-rc.3 +*/ + +// 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..931112b0b6d --- /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: 2.0.0-rc.3 +*/ + +// 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..47130899696 --- /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: 2.0.0-rc.3 +*/ + +// 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..df896e88ca4 --- /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: 2.0.0-rc.3 +*/ + +// 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..c5f885654ae --- /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: 2.0.0-rc.3 +*/ + +// 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..3aec2de0078 --- /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: 2.0.0-rc.3 +*/ + +// 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..7de8f7fae78 --- /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: 2.0.0-rc.3 +*/ + +// 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-fabric/package.json b/packages/cactus-plugin-ledger-connector-fabric/package.json index c1e21fd9d35..791b6b6665b 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/package.json +++ b/packages/cactus-plugin-ledger-connector-fabric/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", 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..8712738f9e0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,71 @@ +.travis.yml +README.md +api/openapi.yaml +api_default.go +client.go +configuration.go +go.mod +go.sum +model_cacti_block_full_event_v1.go +model_cacti_block_full_response_v1.go +model_cacti_block_transaction_event_v1.go +model_cacti_block_transactions_response_v1.go +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_certificate_identity_v1.go +model_fabric_contract_invocation_type.go +model_fabric_signing_credential.go +model_fabric_signing_credential_type.go +model_fabric_x509_certificate_v1.go +model_file_base64.go +model_full_block_transaction_action_v1.go +model_full_block_transaction_endorsement_v1.go +model_full_block_transaction_event_v1.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_type_v1.go +model_get_block_response_v1.go +model_get_chain_info_request_v1.go +model_get_chain_info_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_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 +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..4368d8650f0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,179 @@ +# 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: 2.0.0-rc.3 +- 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* | [**GetChainInfoV1**](docs/DefaultApi.md#getchaininfov1) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-chain-info | Get fabric ledger chain info. +*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 + + - [CactiBlockFullEventV1](docs/CactiBlockFullEventV1.md) + - [CactiBlockFullResponseV1](docs/CactiBlockFullResponseV1.md) + - [CactiBlockTransactionEventV1](docs/CactiBlockTransactionEventV1.md) + - [CactiBlockTransactionsResponseV1](docs/CactiBlockTransactionsResponseV1.md) + - [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) + - [FabricCertificateIdentityV1](docs/FabricCertificateIdentityV1.md) + - [FabricContractInvocationType](docs/FabricContractInvocationType.md) + - [FabricSigningCredential](docs/FabricSigningCredential.md) + - [FabricSigningCredentialType](docs/FabricSigningCredentialType.md) + - [FabricX509CertificateV1](docs/FabricX509CertificateV1.md) + - [FileBase64](docs/FileBase64.md) + - [FullBlockTransactionActionV1](docs/FullBlockTransactionActionV1.md) + - [FullBlockTransactionEndorsementV1](docs/FullBlockTransactionEndorsementV1.md) + - [FullBlockTransactionEventV1](docs/FullBlockTransactionEventV1.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) + - [GetBlockResponseTypeV1](docs/GetBlockResponseTypeV1.md) + - [GetBlockResponseV1](docs/GetBlockResponseV1.md) + - [GetChainInfoRequestV1](docs/GetChainInfoRequestV1.md) + - [GetChainInfoResponseV1](docs/GetChainInfoResponseV1.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) + - [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..1191baf68c2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,2090 @@ +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: 2.0.0-rc.3 +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-chain-info: + post: + operationId: getChainInfoV1 + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GetChainInfoRequestV1' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetChainInfoResponseV1' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponseV1' + description: Internal Server Error + summary: Get fabric ledger chain info. + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-chain-info + /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 + responseType: null + query: + blockHash: + buffer: buffer + encoding: encoding + blockNumber: blockNumber + transactionId: transactionId + 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' + responseType: + $ref: '#/components/schemas/GetBlockResponseTypeV1' + required: + - channelName + - gatewayOptions + - query + type: object + GetChainInfoRequestV1: + description: Request for GetChainInfo 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 + 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' + required: + - channelName + - gatewayOptions + 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/CactiBlockTransactionsResponseV1' + - $ref: '#/components/schemas/CactiBlockFullResponseV1' + - $ref: '#/components/schemas/GetBlockResponseDecodedV1' + - $ref: '#/components/schemas/GetBlockResponseEncodedV1' + GetChainInfoResponseV1: + description: Response from GetChainInfo endpoint. + example: + previousBlockHash: previousBlockHash + currentBlockHash: currentBlockHash + height: 0.8008281904610115 + properties: + height: + description: Current height of fabric ledger + nullable: false + type: number + currentBlockHash: + description: Current block hash of fabric ledger + nullable: false + type: string + previousBlockHash: + description: Previous block hash of fabric ledger + nullable: false + type: string + required: + - currentBlockHash + - height + - previousBlockHash + type: object + 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. 'Cacti*' are custom views, others\ + \ correspond to fabric SDK call." + enum: + - filtered + - full + - private + - cacti:transactions + - cacti:full-block + type: string + x-enum-varnames: + - Filtered + - Full + - Private + - CactiTransactions + - CactiFullBlock + GetBlockResponseTypeV1: + default: full + description: Response type from GetBlock. + enum: + - full + - encoded + - cacti:transactions + - cacti:full-block + type: string + x-enum-varnames: + - Full + - Encoded + - CactiTransactions + - CactiFullBlock + 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 + CactiBlockTransactionEventV1: + 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 + CactiBlockTransactionsResponseV1: + description: Custom response containing block transactions summary. Compatible + with legacy fabric-socketio connector monitoring. + properties: + cactiTransactionsEvents: + description: List of transactions summary + items: + $ref: '#/components/schemas/CactiBlockTransactionEventV1' + type: array + required: + - cactiTransactionsEvents + type: object + CactiBlockFullResponseV1: + description: Custom response containing full block summary. + properties: + cactiFullEvents: + $ref: '#/components/schemas/CactiBlockFullEventV1' + required: + - cactiFullEvents + 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 + FabricX509CertificateV1: + description: Transaction endorser certificate object + properties: + issuer: + nullable: false + type: string + serialNumber: + nullable: false + type: string + subject: + nullable: false + type: string + subjectAltName: + nullable: false + type: string + validFrom: + nullable: false + type: string + validTo: + nullable: false + type: string + pem: + nullable: false + type: string + required: + - issuer + - pem + - serialNumber + - subject + - subjectAltName + - validFrom + - validTo + type: object + FabricCertificateIdentityV1: + description: Combination of certificate and it's MSP ID used to identify fabric + actors. + properties: + mspid: + nullable: false + type: string + cert: + $ref: '#/components/schemas/FabricX509CertificateV1' + required: + - cert + - mspid + type: object + FullBlockTransactionEndorsementV1: + description: Transaction endorsment object returned from fabric block. + properties: + signer: + $ref: '#/components/schemas/FabricCertificateIdentityV1' + signature: + nullable: false + type: string + required: + - signature + - signer + type: object + FullBlockTransactionActionV1: + description: Transaction action returned from fabric block. + properties: + functionName: + nullable: false + type: string + functionArgs: + items: + nullable: false + type: string + type: array + chaincodeId: + nullable: false + type: string + creator: + $ref: '#/components/schemas/FabricCertificateIdentityV1' + endorsements: + items: + $ref: '#/components/schemas/FullBlockTransactionEndorsementV1' + type: array + required: + - chaincodeId + - creator + - endorsements + - functionArgs + - functionName + type: object + FullBlockTransactionEventV1: + description: Transaction returned from fabric block. + properties: + hash: + nullable: false + type: string + channelId: + nullable: false + type: string + timestamp: + nullable: false + type: string + protocolVersion: + nullable: false + type: number + transactionType: + nullable: false + type: string + epoch: + nullable: false + type: number + actions: + items: + $ref: '#/components/schemas/FullBlockTransactionActionV1' + type: array + required: + - actions + - channelId + - epoch + - hash + - protocolVersion + - timestamp + - transactionType + type: object + CactiBlockFullEventV1: + description: Custom format full fabric block with transactions + properties: + blockNumber: + nullable: false + type: number + blockHash: + nullable: false + type: string + previousBlockHash: + nullable: false + type: string + transactionCount: + nullable: false + type: number + cactiTransactionsEvents: + items: + $ref: '#/components/schemas/FullBlockTransactionEventV1' + type: array + required: + - blockHash + - blockNumber + - cactiTransactionsEvents + - previousBlockHash + - transactionCount + 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/CactiBlockTransactionsResponseV1' + - $ref: '#/components/schemas/CactiBlockFullResponseV1' + - $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..ecdceafe214 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,930 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 ApiGetChainInfoV1Request struct { + ctx context.Context + ApiService *DefaultApiService + getChainInfoRequestV1 *GetChainInfoRequestV1 +} + +func (r ApiGetChainInfoV1Request) GetChainInfoRequestV1(getChainInfoRequestV1 GetChainInfoRequestV1) ApiGetChainInfoV1Request { + r.getChainInfoRequestV1 = &getChainInfoRequestV1 + return r +} + +func (r ApiGetChainInfoV1Request) Execute() (*GetChainInfoResponseV1, *http.Response, error) { + return r.ApiService.GetChainInfoV1Execute(r) +} + +/* +GetChainInfoV1 Get fabric ledger chain info. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetChainInfoV1Request +*/ +func (a *DefaultApiService) GetChainInfoV1(ctx context.Context) ApiGetChainInfoV1Request { + return ApiGetChainInfoV1Request{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetChainInfoResponseV1 +func (a *DefaultApiService) GetChainInfoV1Execute(r ApiGetChainInfoV1Request) (*GetChainInfoResponseV1, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetChainInfoResponseV1 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetChainInfoV1") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/get-chain-info" + + 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.getChainInfoRequestV1 + 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..16709918e19 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..875158f7618 --- /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: 2.0.0-rc.3 +*/ + +// 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_cacti_block_full_event_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_full_event_v1.go new file mode 100644 index 00000000000..8decb9c9056 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_full_event_v1.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the CactiBlockFullEventV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiBlockFullEventV1{} + +// CactiBlockFullEventV1 Custom format full fabric block with transactions +type CactiBlockFullEventV1 struct { + BlockNumber float32 `json:"blockNumber"` + BlockHash string `json:"blockHash"` + PreviousBlockHash string `json:"previousBlockHash"` + TransactionCount float32 `json:"transactionCount"` + CactiTransactionsEvents []FullBlockTransactionEventV1 `json:"cactiTransactionsEvents"` +} + +// NewCactiBlockFullEventV1 instantiates a new CactiBlockFullEventV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactiBlockFullEventV1(blockNumber float32, blockHash string, previousBlockHash string, transactionCount float32, cactiTransactionsEvents []FullBlockTransactionEventV1) *CactiBlockFullEventV1 { + this := CactiBlockFullEventV1{} + this.BlockNumber = blockNumber + this.BlockHash = blockHash + this.PreviousBlockHash = previousBlockHash + this.TransactionCount = transactionCount + this.CactiTransactionsEvents = cactiTransactionsEvents + return &this +} + +// NewCactiBlockFullEventV1WithDefaults instantiates a new CactiBlockFullEventV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiBlockFullEventV1WithDefaults() *CactiBlockFullEventV1 { + this := CactiBlockFullEventV1{} + return &this +} + +// GetBlockNumber returns the BlockNumber field value +func (o *CactiBlockFullEventV1) 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 *CactiBlockFullEventV1) GetBlockNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.BlockNumber, true +} + +// SetBlockNumber sets field value +func (o *CactiBlockFullEventV1) SetBlockNumber(v float32) { + o.BlockNumber = v +} + +// GetBlockHash returns the BlockHash field value +func (o *CactiBlockFullEventV1) 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 *CactiBlockFullEventV1) GetBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *CactiBlockFullEventV1) SetBlockHash(v string) { + o.BlockHash = v +} + +// GetPreviousBlockHash returns the PreviousBlockHash field value +func (o *CactiBlockFullEventV1) GetPreviousBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.PreviousBlockHash +} + +// GetPreviousBlockHashOk returns a tuple with the PreviousBlockHash field value +// and a boolean to check if the value has been set. +func (o *CactiBlockFullEventV1) GetPreviousBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreviousBlockHash, true +} + +// SetPreviousBlockHash sets field value +func (o *CactiBlockFullEventV1) SetPreviousBlockHash(v string) { + o.PreviousBlockHash = v +} + +// GetTransactionCount returns the TransactionCount field value +func (o *CactiBlockFullEventV1) GetTransactionCount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TransactionCount +} + +// GetTransactionCountOk returns a tuple with the TransactionCount field value +// and a boolean to check if the value has been set. +func (o *CactiBlockFullEventV1) GetTransactionCountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TransactionCount, true +} + +// SetTransactionCount sets field value +func (o *CactiBlockFullEventV1) SetTransactionCount(v float32) { + o.TransactionCount = v +} + +// GetCactiTransactionsEvents returns the CactiTransactionsEvents field value +func (o *CactiBlockFullEventV1) GetCactiTransactionsEvents() []FullBlockTransactionEventV1 { + if o == nil { + var ret []FullBlockTransactionEventV1 + 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 *CactiBlockFullEventV1) GetCactiTransactionsEventsOk() ([]FullBlockTransactionEventV1, bool) { + if o == nil { + return nil, false + } + return o.CactiTransactionsEvents, true +} + +// SetCactiTransactionsEvents sets field value +func (o *CactiBlockFullEventV1) SetCactiTransactionsEvents(v []FullBlockTransactionEventV1) { + o.CactiTransactionsEvents = v +} + +func (o CactiBlockFullEventV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiBlockFullEventV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["blockNumber"] = o.BlockNumber + toSerialize["blockHash"] = o.BlockHash + toSerialize["previousBlockHash"] = o.PreviousBlockHash + toSerialize["transactionCount"] = o.TransactionCount + toSerialize["cactiTransactionsEvents"] = o.CactiTransactionsEvents + return toSerialize, nil +} + +type NullableCactiBlockFullEventV1 struct { + value *CactiBlockFullEventV1 + isSet bool +} + +func (v NullableCactiBlockFullEventV1) Get() *CactiBlockFullEventV1 { + return v.value +} + +func (v *NullableCactiBlockFullEventV1) Set(val *CactiBlockFullEventV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiBlockFullEventV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiBlockFullEventV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiBlockFullEventV1(val *CactiBlockFullEventV1) *NullableCactiBlockFullEventV1 { + return &NullableCactiBlockFullEventV1{value: val, isSet: true} +} + +func (v NullableCactiBlockFullEventV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiBlockFullEventV1) 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_cacti_block_full_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_full_response_v1.go new file mode 100644 index 00000000000..a3d410f8bf1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_full_response_v1.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the CactiBlockFullResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiBlockFullResponseV1{} + +// CactiBlockFullResponseV1 Custom response containing full block summary. +type CactiBlockFullResponseV1 struct { + CactiFullEvents CactiBlockFullEventV1 `json:"cactiFullEvents"` +} + +// NewCactiBlockFullResponseV1 instantiates a new CactiBlockFullResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactiBlockFullResponseV1(cactiFullEvents CactiBlockFullEventV1) *CactiBlockFullResponseV1 { + this := CactiBlockFullResponseV1{} + this.CactiFullEvents = cactiFullEvents + return &this +} + +// NewCactiBlockFullResponseV1WithDefaults instantiates a new CactiBlockFullResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiBlockFullResponseV1WithDefaults() *CactiBlockFullResponseV1 { + this := CactiBlockFullResponseV1{} + return &this +} + +// GetCactiFullEvents returns the CactiFullEvents field value +func (o *CactiBlockFullResponseV1) GetCactiFullEvents() CactiBlockFullEventV1 { + if o == nil { + var ret CactiBlockFullEventV1 + return ret + } + + return o.CactiFullEvents +} + +// GetCactiFullEventsOk returns a tuple with the CactiFullEvents field value +// and a boolean to check if the value has been set. +func (o *CactiBlockFullResponseV1) GetCactiFullEventsOk() (*CactiBlockFullEventV1, bool) { + if o == nil { + return nil, false + } + return &o.CactiFullEvents, true +} + +// SetCactiFullEvents sets field value +func (o *CactiBlockFullResponseV1) SetCactiFullEvents(v CactiBlockFullEventV1) { + o.CactiFullEvents = v +} + +func (o CactiBlockFullResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiBlockFullResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cactiFullEvents"] = o.CactiFullEvents + return toSerialize, nil +} + +type NullableCactiBlockFullResponseV1 struct { + value *CactiBlockFullResponseV1 + isSet bool +} + +func (v NullableCactiBlockFullResponseV1) Get() *CactiBlockFullResponseV1 { + return v.value +} + +func (v *NullableCactiBlockFullResponseV1) Set(val *CactiBlockFullResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiBlockFullResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiBlockFullResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiBlockFullResponseV1(val *CactiBlockFullResponseV1) *NullableCactiBlockFullResponseV1 { + return &NullableCactiBlockFullResponseV1{value: val, isSet: true} +} + +func (v NullableCactiBlockFullResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiBlockFullResponseV1) 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_cacti_block_transaction_event_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_transaction_event_v1.go new file mode 100644 index 00000000000..3ff14a5745e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_transaction_event_v1.go @@ -0,0 +1,202 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the CactiBlockTransactionEventV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiBlockTransactionEventV1{} + +// CactiBlockTransactionEventV1 Transaction summary from commited block. +type CactiBlockTransactionEventV1 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"` +} + +// NewCactiBlockTransactionEventV1 instantiates a new CactiBlockTransactionEventV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactiBlockTransactionEventV1(chaincodeId string, transactionId string, functionName string, functionArgs []string) *CactiBlockTransactionEventV1 { + this := CactiBlockTransactionEventV1{} + this.ChaincodeId = chaincodeId + this.TransactionId = transactionId + this.FunctionName = functionName + this.FunctionArgs = functionArgs + return &this +} + +// NewCactiBlockTransactionEventV1WithDefaults instantiates a new CactiBlockTransactionEventV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiBlockTransactionEventV1WithDefaults() *CactiBlockTransactionEventV1 { + this := CactiBlockTransactionEventV1{} + return &this +} + +// GetChaincodeId returns the ChaincodeId field value +func (o *CactiBlockTransactionEventV1) 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 *CactiBlockTransactionEventV1) GetChaincodeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChaincodeId, true +} + +// SetChaincodeId sets field value +func (o *CactiBlockTransactionEventV1) SetChaincodeId(v string) { + o.ChaincodeId = v +} + +// GetTransactionId returns the TransactionId field value +func (o *CactiBlockTransactionEventV1) 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 *CactiBlockTransactionEventV1) GetTransactionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionId, true +} + +// SetTransactionId sets field value +func (o *CactiBlockTransactionEventV1) SetTransactionId(v string) { + o.TransactionId = v +} + +// GetFunctionName returns the FunctionName field value +func (o *CactiBlockTransactionEventV1) 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 *CactiBlockTransactionEventV1) GetFunctionNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionName, true +} + +// SetFunctionName sets field value +func (o *CactiBlockTransactionEventV1) SetFunctionName(v string) { + o.FunctionName = v +} + +// GetFunctionArgs returns the FunctionArgs field value +func (o *CactiBlockTransactionEventV1) 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 *CactiBlockTransactionEventV1) GetFunctionArgsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.FunctionArgs, true +} + +// SetFunctionArgs sets field value +func (o *CactiBlockTransactionEventV1) SetFunctionArgs(v []string) { + o.FunctionArgs = v +} + +func (o CactiBlockTransactionEventV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiBlockTransactionEventV1) 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 NullableCactiBlockTransactionEventV1 struct { + value *CactiBlockTransactionEventV1 + isSet bool +} + +func (v NullableCactiBlockTransactionEventV1) Get() *CactiBlockTransactionEventV1 { + return v.value +} + +func (v *NullableCactiBlockTransactionEventV1) Set(val *CactiBlockTransactionEventV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiBlockTransactionEventV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiBlockTransactionEventV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiBlockTransactionEventV1(val *CactiBlockTransactionEventV1) *NullableCactiBlockTransactionEventV1 { + return &NullableCactiBlockTransactionEventV1{value: val, isSet: true} +} + +func (v NullableCactiBlockTransactionEventV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiBlockTransactionEventV1) 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_cacti_block_transactions_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_transactions_response_v1.go new file mode 100644 index 00000000000..9d35e6f9bd7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_cacti_block_transactions_response_v1.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the CactiBlockTransactionsResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CactiBlockTransactionsResponseV1{} + +// CactiBlockTransactionsResponseV1 Custom response containing block transactions summary. Compatible with legacy fabric-socketio connector monitoring. +type CactiBlockTransactionsResponseV1 struct { + // List of transactions summary + CactiTransactionsEvents []CactiBlockTransactionEventV1 `json:"cactiTransactionsEvents"` +} + +// NewCactiBlockTransactionsResponseV1 instantiates a new CactiBlockTransactionsResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCactiBlockTransactionsResponseV1(cactiTransactionsEvents []CactiBlockTransactionEventV1) *CactiBlockTransactionsResponseV1 { + this := CactiBlockTransactionsResponseV1{} + this.CactiTransactionsEvents = cactiTransactionsEvents + return &this +} + +// NewCactiBlockTransactionsResponseV1WithDefaults instantiates a new CactiBlockTransactionsResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCactiBlockTransactionsResponseV1WithDefaults() *CactiBlockTransactionsResponseV1 { + this := CactiBlockTransactionsResponseV1{} + return &this +} + +// GetCactiTransactionsEvents returns the CactiTransactionsEvents field value +func (o *CactiBlockTransactionsResponseV1) GetCactiTransactionsEvents() []CactiBlockTransactionEventV1 { + if o == nil { + var ret []CactiBlockTransactionEventV1 + 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 *CactiBlockTransactionsResponseV1) GetCactiTransactionsEventsOk() ([]CactiBlockTransactionEventV1, bool) { + if o == nil { + return nil, false + } + return o.CactiTransactionsEvents, true +} + +// SetCactiTransactionsEvents sets field value +func (o *CactiBlockTransactionsResponseV1) SetCactiTransactionsEvents(v []CactiBlockTransactionEventV1) { + o.CactiTransactionsEvents = v +} + +func (o CactiBlockTransactionsResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CactiBlockTransactionsResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cactiTransactionsEvents"] = o.CactiTransactionsEvents + return toSerialize, nil +} + +type NullableCactiBlockTransactionsResponseV1 struct { + value *CactiBlockTransactionsResponseV1 + isSet bool +} + +func (v NullableCactiBlockTransactionsResponseV1) Get() *CactiBlockTransactionsResponseV1 { + return v.value +} + +func (v *NullableCactiBlockTransactionsResponseV1) Set(val *CactiBlockTransactionsResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableCactiBlockTransactionsResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableCactiBlockTransactionsResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCactiBlockTransactionsResponseV1(val *CactiBlockTransactionsResponseV1) *NullableCactiBlockTransactionsResponseV1 { + return &NullableCactiBlockTransactionsResponseV1{value: val, isSet: true} +} + +func (v NullableCactiBlockTransactionsResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCactiBlockTransactionsResponseV1) 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_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..12986c309c3 --- /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: 2.0.0-rc.3 +*/ + +// 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..4f10d25c286 --- /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: 2.0.0-rc.3 +*/ + +// 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..71b293e5f18 --- /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: 2.0.0-rc.3 +*/ + +// 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..ecbf84c076c --- /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: 2.0.0-rc.3 +*/ + +// 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..684074ed31b --- /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: 2.0.0-rc.3 +*/ + +// 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..b6475e840be --- /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: 2.0.0-rc.3 +*/ + +// 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..d2c5844cc0b --- /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: 2.0.0-rc.3 +*/ + +// 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..8a7b552afd2 --- /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: 2.0.0-rc.3 +*/ + +// 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..fc81301649a --- /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: 2.0.0-rc.3 +*/ + +// 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..e3abf2cb4c2 --- /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: 2.0.0-rc.3 +*/ + +// 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..45bf0f69aa3 --- /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: 2.0.0-rc.3 +*/ + +// 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..0a06e2fcb63 --- /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: 2.0.0-rc.3 +*/ + +// 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..38fed5db13c --- /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: 2.0.0-rc.3 +*/ + +// 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..5b2acf889d8 --- /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: 2.0.0-rc.3 +*/ + +// 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..8115d8d61bf --- /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: 2.0.0-rc.3 +*/ + +// 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_certificate_identity_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_certificate_identity_v1.go new file mode 100644 index 00000000000..577a305f162 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_certificate_identity_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FabricCertificateIdentityV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FabricCertificateIdentityV1{} + +// FabricCertificateIdentityV1 Combination of certificate and it's MSP ID used to identify fabric actors. +type FabricCertificateIdentityV1 struct { + Mspid string `json:"mspid"` + Cert FabricX509CertificateV1 `json:"cert"` +} + +// NewFabricCertificateIdentityV1 instantiates a new FabricCertificateIdentityV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFabricCertificateIdentityV1(mspid string, cert FabricX509CertificateV1) *FabricCertificateIdentityV1 { + this := FabricCertificateIdentityV1{} + this.Mspid = mspid + this.Cert = cert + return &this +} + +// NewFabricCertificateIdentityV1WithDefaults instantiates a new FabricCertificateIdentityV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFabricCertificateIdentityV1WithDefaults() *FabricCertificateIdentityV1 { + this := FabricCertificateIdentityV1{} + return &this +} + +// GetMspid returns the Mspid field value +func (o *FabricCertificateIdentityV1) GetMspid() string { + if o == nil { + var ret string + return ret + } + + return o.Mspid +} + +// GetMspidOk returns a tuple with the Mspid field value +// and a boolean to check if the value has been set. +func (o *FabricCertificateIdentityV1) GetMspidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mspid, true +} + +// SetMspid sets field value +func (o *FabricCertificateIdentityV1) SetMspid(v string) { + o.Mspid = v +} + +// GetCert returns the Cert field value +func (o *FabricCertificateIdentityV1) GetCert() FabricX509CertificateV1 { + if o == nil { + var ret FabricX509CertificateV1 + return ret + } + + return o.Cert +} + +// GetCertOk returns a tuple with the Cert field value +// and a boolean to check if the value has been set. +func (o *FabricCertificateIdentityV1) GetCertOk() (*FabricX509CertificateV1, bool) { + if o == nil { + return nil, false + } + return &o.Cert, true +} + +// SetCert sets field value +func (o *FabricCertificateIdentityV1) SetCert(v FabricX509CertificateV1) { + o.Cert = v +} + +func (o FabricCertificateIdentityV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FabricCertificateIdentityV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["mspid"] = o.Mspid + toSerialize["cert"] = o.Cert + return toSerialize, nil +} + +type NullableFabricCertificateIdentityV1 struct { + value *FabricCertificateIdentityV1 + isSet bool +} + +func (v NullableFabricCertificateIdentityV1) Get() *FabricCertificateIdentityV1 { + return v.value +} + +func (v *NullableFabricCertificateIdentityV1) Set(val *FabricCertificateIdentityV1) { + v.value = val + v.isSet = true +} + +func (v NullableFabricCertificateIdentityV1) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricCertificateIdentityV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricCertificateIdentityV1(val *FabricCertificateIdentityV1) *NullableFabricCertificateIdentityV1 { + return &NullableFabricCertificateIdentityV1{value: val, isSet: true} +} + +func (v NullableFabricCertificateIdentityV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricCertificateIdentityV1) 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..4c11682eb28 --- /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: 2.0.0-rc.3 +*/ + +// 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..d9dc91f06f6 --- /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: 2.0.0-rc.3 +*/ + +// 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..b172f481314 --- /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: 2.0.0-rc.3 +*/ + +// 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_fabric_x509_certificate_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_x509_certificate_v1.go new file mode 100644 index 00000000000..79ca2e63277 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_fabric_x509_certificate_v1.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FabricX509CertificateV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FabricX509CertificateV1{} + +// FabricX509CertificateV1 Transaction endorser certificate object +type FabricX509CertificateV1 struct { + Issuer string `json:"issuer"` + SerialNumber string `json:"serialNumber"` + Subject string `json:"subject"` + SubjectAltName string `json:"subjectAltName"` + ValidFrom string `json:"validFrom"` + ValidTo string `json:"validTo"` + Pem string `json:"pem"` +} + +// NewFabricX509CertificateV1 instantiates a new FabricX509CertificateV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFabricX509CertificateV1(issuer string, serialNumber string, subject string, subjectAltName string, validFrom string, validTo string, pem string) *FabricX509CertificateV1 { + this := FabricX509CertificateV1{} + this.Issuer = issuer + this.SerialNumber = serialNumber + this.Subject = subject + this.SubjectAltName = subjectAltName + this.ValidFrom = validFrom + this.ValidTo = validTo + this.Pem = pem + return &this +} + +// NewFabricX509CertificateV1WithDefaults instantiates a new FabricX509CertificateV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFabricX509CertificateV1WithDefaults() *FabricX509CertificateV1 { + this := FabricX509CertificateV1{} + return &this +} + +// GetIssuer returns the Issuer field value +func (o *FabricX509CertificateV1) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *FabricX509CertificateV1) SetIssuer(v string) { + o.Issuer = v +} + +// GetSerialNumber returns the SerialNumber field value +func (o *FabricX509CertificateV1) GetSerialNumber() string { + if o == nil { + var ret string + return ret + } + + return o.SerialNumber +} + +// GetSerialNumberOk returns a tuple with the SerialNumber field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetSerialNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SerialNumber, true +} + +// SetSerialNumber sets field value +func (o *FabricX509CertificateV1) SetSerialNumber(v string) { + o.SerialNumber = v +} + +// GetSubject returns the Subject field value +func (o *FabricX509CertificateV1) GetSubject() string { + if o == nil { + var ret string + return ret + } + + return o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetSubjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Subject, true +} + +// SetSubject sets field value +func (o *FabricX509CertificateV1) SetSubject(v string) { + o.Subject = v +} + +// GetSubjectAltName returns the SubjectAltName field value +func (o *FabricX509CertificateV1) GetSubjectAltName() string { + if o == nil { + var ret string + return ret + } + + return o.SubjectAltName +} + +// GetSubjectAltNameOk returns a tuple with the SubjectAltName field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetSubjectAltNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SubjectAltName, true +} + +// SetSubjectAltName sets field value +func (o *FabricX509CertificateV1) SetSubjectAltName(v string) { + o.SubjectAltName = v +} + +// GetValidFrom returns the ValidFrom field value +func (o *FabricX509CertificateV1) GetValidFrom() string { + if o == nil { + var ret string + return ret + } + + return o.ValidFrom +} + +// GetValidFromOk returns a tuple with the ValidFrom field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetValidFromOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ValidFrom, true +} + +// SetValidFrom sets field value +func (o *FabricX509CertificateV1) SetValidFrom(v string) { + o.ValidFrom = v +} + +// GetValidTo returns the ValidTo field value +func (o *FabricX509CertificateV1) GetValidTo() string { + if o == nil { + var ret string + return ret + } + + return o.ValidTo +} + +// GetValidToOk returns a tuple with the ValidTo field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetValidToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ValidTo, true +} + +// SetValidTo sets field value +func (o *FabricX509CertificateV1) SetValidTo(v string) { + o.ValidTo = v +} + +// GetPem returns the Pem field value +func (o *FabricX509CertificateV1) GetPem() string { + if o == nil { + var ret string + return ret + } + + return o.Pem +} + +// GetPemOk returns a tuple with the Pem field value +// and a boolean to check if the value has been set. +func (o *FabricX509CertificateV1) GetPemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pem, true +} + +// SetPem sets field value +func (o *FabricX509CertificateV1) SetPem(v string) { + o.Pem = v +} + +func (o FabricX509CertificateV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FabricX509CertificateV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["issuer"] = o.Issuer + toSerialize["serialNumber"] = o.SerialNumber + toSerialize["subject"] = o.Subject + toSerialize["subjectAltName"] = o.SubjectAltName + toSerialize["validFrom"] = o.ValidFrom + toSerialize["validTo"] = o.ValidTo + toSerialize["pem"] = o.Pem + return toSerialize, nil +} + +type NullableFabricX509CertificateV1 struct { + value *FabricX509CertificateV1 + isSet bool +} + +func (v NullableFabricX509CertificateV1) Get() *FabricX509CertificateV1 { + return v.value +} + +func (v *NullableFabricX509CertificateV1) Set(val *FabricX509CertificateV1) { + v.value = val + v.isSet = true +} + +func (v NullableFabricX509CertificateV1) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricX509CertificateV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricX509CertificateV1(val *FabricX509CertificateV1) *NullableFabricX509CertificateV1 { + return &NullableFabricX509CertificateV1{value: val, isSet: true} +} + +func (v NullableFabricX509CertificateV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricX509CertificateV1) 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..f5de2f4802a --- /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: 2.0.0-rc.3 +*/ + +// 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_full_block_transaction_action_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_action_v1.go new file mode 100644 index 00000000000..42a607a54f2 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_action_v1.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FullBlockTransactionActionV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FullBlockTransactionActionV1{} + +// FullBlockTransactionActionV1 Transaction action returned from fabric block. +type FullBlockTransactionActionV1 struct { + FunctionName string `json:"functionName"` + FunctionArgs []string `json:"functionArgs"` + ChaincodeId string `json:"chaincodeId"` + Creator FabricCertificateIdentityV1 `json:"creator"` + Endorsements []FullBlockTransactionEndorsementV1 `json:"endorsements"` +} + +// NewFullBlockTransactionActionV1 instantiates a new FullBlockTransactionActionV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFullBlockTransactionActionV1(functionName string, functionArgs []string, chaincodeId string, creator FabricCertificateIdentityV1, endorsements []FullBlockTransactionEndorsementV1) *FullBlockTransactionActionV1 { + this := FullBlockTransactionActionV1{} + this.FunctionName = functionName + this.FunctionArgs = functionArgs + this.ChaincodeId = chaincodeId + this.Creator = creator + this.Endorsements = endorsements + return &this +} + +// NewFullBlockTransactionActionV1WithDefaults instantiates a new FullBlockTransactionActionV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFullBlockTransactionActionV1WithDefaults() *FullBlockTransactionActionV1 { + this := FullBlockTransactionActionV1{} + return &this +} + +// GetFunctionName returns the FunctionName field value +func (o *FullBlockTransactionActionV1) 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 *FullBlockTransactionActionV1) GetFunctionNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FunctionName, true +} + +// SetFunctionName sets field value +func (o *FullBlockTransactionActionV1) SetFunctionName(v string) { + o.FunctionName = v +} + +// GetFunctionArgs returns the FunctionArgs field value +func (o *FullBlockTransactionActionV1) 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 *FullBlockTransactionActionV1) GetFunctionArgsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.FunctionArgs, true +} + +// SetFunctionArgs sets field value +func (o *FullBlockTransactionActionV1) SetFunctionArgs(v []string) { + o.FunctionArgs = v +} + +// GetChaincodeId returns the ChaincodeId field value +func (o *FullBlockTransactionActionV1) 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 *FullBlockTransactionActionV1) GetChaincodeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChaincodeId, true +} + +// SetChaincodeId sets field value +func (o *FullBlockTransactionActionV1) SetChaincodeId(v string) { + o.ChaincodeId = v +} + +// GetCreator returns the Creator field value +func (o *FullBlockTransactionActionV1) GetCreator() FabricCertificateIdentityV1 { + if o == nil { + var ret FabricCertificateIdentityV1 + return ret + } + + return o.Creator +} + +// GetCreatorOk returns a tuple with the Creator field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionActionV1) GetCreatorOk() (*FabricCertificateIdentityV1, bool) { + if o == nil { + return nil, false + } + return &o.Creator, true +} + +// SetCreator sets field value +func (o *FullBlockTransactionActionV1) SetCreator(v FabricCertificateIdentityV1) { + o.Creator = v +} + +// GetEndorsements returns the Endorsements field value +func (o *FullBlockTransactionActionV1) GetEndorsements() []FullBlockTransactionEndorsementV1 { + if o == nil { + var ret []FullBlockTransactionEndorsementV1 + return ret + } + + return o.Endorsements +} + +// GetEndorsementsOk returns a tuple with the Endorsements field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionActionV1) GetEndorsementsOk() ([]FullBlockTransactionEndorsementV1, bool) { + if o == nil { + return nil, false + } + return o.Endorsements, true +} + +// SetEndorsements sets field value +func (o *FullBlockTransactionActionV1) SetEndorsements(v []FullBlockTransactionEndorsementV1) { + o.Endorsements = v +} + +func (o FullBlockTransactionActionV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FullBlockTransactionActionV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["functionName"] = o.FunctionName + toSerialize["functionArgs"] = o.FunctionArgs + toSerialize["chaincodeId"] = o.ChaincodeId + toSerialize["creator"] = o.Creator + toSerialize["endorsements"] = o.Endorsements + return toSerialize, nil +} + +type NullableFullBlockTransactionActionV1 struct { + value *FullBlockTransactionActionV1 + isSet bool +} + +func (v NullableFullBlockTransactionActionV1) Get() *FullBlockTransactionActionV1 { + return v.value +} + +func (v *NullableFullBlockTransactionActionV1) Set(val *FullBlockTransactionActionV1) { + v.value = val + v.isSet = true +} + +func (v NullableFullBlockTransactionActionV1) IsSet() bool { + return v.isSet +} + +func (v *NullableFullBlockTransactionActionV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFullBlockTransactionActionV1(val *FullBlockTransactionActionV1) *NullableFullBlockTransactionActionV1 { + return &NullableFullBlockTransactionActionV1{value: val, isSet: true} +} + +func (v NullableFullBlockTransactionActionV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFullBlockTransactionActionV1) 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_full_block_transaction_endorsement_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_endorsement_v1.go new file mode 100644 index 00000000000..4646460d955 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_endorsement_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FullBlockTransactionEndorsementV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FullBlockTransactionEndorsementV1{} + +// FullBlockTransactionEndorsementV1 Transaction endorsment object returned from fabric block. +type FullBlockTransactionEndorsementV1 struct { + Signer FabricCertificateIdentityV1 `json:"signer"` + Signature string `json:"signature"` +} + +// NewFullBlockTransactionEndorsementV1 instantiates a new FullBlockTransactionEndorsementV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFullBlockTransactionEndorsementV1(signer FabricCertificateIdentityV1, signature string) *FullBlockTransactionEndorsementV1 { + this := FullBlockTransactionEndorsementV1{} + this.Signer = signer + this.Signature = signature + return &this +} + +// NewFullBlockTransactionEndorsementV1WithDefaults instantiates a new FullBlockTransactionEndorsementV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFullBlockTransactionEndorsementV1WithDefaults() *FullBlockTransactionEndorsementV1 { + this := FullBlockTransactionEndorsementV1{} + return &this +} + +// GetSigner returns the Signer field value +func (o *FullBlockTransactionEndorsementV1) GetSigner() FabricCertificateIdentityV1 { + if o == nil { + var ret FabricCertificateIdentityV1 + return ret + } + + return o.Signer +} + +// GetSignerOk returns a tuple with the Signer field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionEndorsementV1) GetSignerOk() (*FabricCertificateIdentityV1, bool) { + if o == nil { + return nil, false + } + return &o.Signer, true +} + +// SetSigner sets field value +func (o *FullBlockTransactionEndorsementV1) SetSigner(v FabricCertificateIdentityV1) { + o.Signer = v +} + +// GetSignature returns the Signature field value +func (o *FullBlockTransactionEndorsementV1) 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 *FullBlockTransactionEndorsementV1) GetSignatureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Signature, true +} + +// SetSignature sets field value +func (o *FullBlockTransactionEndorsementV1) SetSignature(v string) { + o.Signature = v +} + +func (o FullBlockTransactionEndorsementV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FullBlockTransactionEndorsementV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["signer"] = o.Signer + toSerialize["signature"] = o.Signature + return toSerialize, nil +} + +type NullableFullBlockTransactionEndorsementV1 struct { + value *FullBlockTransactionEndorsementV1 + isSet bool +} + +func (v NullableFullBlockTransactionEndorsementV1) Get() *FullBlockTransactionEndorsementV1 { + return v.value +} + +func (v *NullableFullBlockTransactionEndorsementV1) Set(val *FullBlockTransactionEndorsementV1) { + v.value = val + v.isSet = true +} + +func (v NullableFullBlockTransactionEndorsementV1) IsSet() bool { + return v.isSet +} + +func (v *NullableFullBlockTransactionEndorsementV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFullBlockTransactionEndorsementV1(val *FullBlockTransactionEndorsementV1) *NullableFullBlockTransactionEndorsementV1 { + return &NullableFullBlockTransactionEndorsementV1{value: val, isSet: true} +} + +func (v NullableFullBlockTransactionEndorsementV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFullBlockTransactionEndorsementV1) 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_full_block_transaction_event_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_event_v1.go new file mode 100644 index 00000000000..fecf95e668e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_full_block_transaction_event_v1.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the FullBlockTransactionEventV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FullBlockTransactionEventV1{} + +// FullBlockTransactionEventV1 Transaction returned from fabric block. +type FullBlockTransactionEventV1 struct { + Hash string `json:"hash"` + ChannelId string `json:"channelId"` + Timestamp string `json:"timestamp"` + ProtocolVersion float32 `json:"protocolVersion"` + TransactionType string `json:"transactionType"` + Epoch float32 `json:"epoch"` + Actions []FullBlockTransactionActionV1 `json:"actions"` +} + +// NewFullBlockTransactionEventV1 instantiates a new FullBlockTransactionEventV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFullBlockTransactionEventV1(hash string, channelId string, timestamp string, protocolVersion float32, transactionType string, epoch float32, actions []FullBlockTransactionActionV1) *FullBlockTransactionEventV1 { + this := FullBlockTransactionEventV1{} + this.Hash = hash + this.ChannelId = channelId + this.Timestamp = timestamp + this.ProtocolVersion = protocolVersion + this.TransactionType = transactionType + this.Epoch = epoch + this.Actions = actions + return &this +} + +// NewFullBlockTransactionEventV1WithDefaults instantiates a new FullBlockTransactionEventV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFullBlockTransactionEventV1WithDefaults() *FullBlockTransactionEventV1 { + this := FullBlockTransactionEventV1{} + return &this +} + +// GetHash returns the Hash field value +func (o *FullBlockTransactionEventV1) 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 *FullBlockTransactionEventV1) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *FullBlockTransactionEventV1) SetHash(v string) { + o.Hash = v +} + +// GetChannelId returns the ChannelId field value +func (o *FullBlockTransactionEventV1) 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 *FullBlockTransactionEventV1) GetChannelIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelId, true +} + +// SetChannelId sets field value +func (o *FullBlockTransactionEventV1) SetChannelId(v string) { + o.ChannelId = v +} + +// GetTimestamp returns the Timestamp field value +func (o *FullBlockTransactionEventV1) 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 *FullBlockTransactionEventV1) GetTimestampOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *FullBlockTransactionEventV1) SetTimestamp(v string) { + o.Timestamp = v +} + +// GetProtocolVersion returns the ProtocolVersion field value +func (o *FullBlockTransactionEventV1) GetProtocolVersion() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.ProtocolVersion +} + +// GetProtocolVersionOk returns a tuple with the ProtocolVersion field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionEventV1) GetProtocolVersionOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.ProtocolVersion, true +} + +// SetProtocolVersion sets field value +func (o *FullBlockTransactionEventV1) SetProtocolVersion(v float32) { + o.ProtocolVersion = v +} + +// GetTransactionType returns the TransactionType field value +func (o *FullBlockTransactionEventV1) GetTransactionType() string { + if o == nil { + var ret string + return ret + } + + return o.TransactionType +} + +// GetTransactionTypeOk returns a tuple with the TransactionType field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionEventV1) GetTransactionTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransactionType, true +} + +// SetTransactionType sets field value +func (o *FullBlockTransactionEventV1) SetTransactionType(v string) { + o.TransactionType = v +} + +// GetEpoch returns the Epoch field value +func (o *FullBlockTransactionEventV1) GetEpoch() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Epoch +} + +// GetEpochOk returns a tuple with the Epoch field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionEventV1) GetEpochOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Epoch, true +} + +// SetEpoch sets field value +func (o *FullBlockTransactionEventV1) SetEpoch(v float32) { + o.Epoch = v +} + +// GetActions returns the Actions field value +func (o *FullBlockTransactionEventV1) GetActions() []FullBlockTransactionActionV1 { + if o == nil { + var ret []FullBlockTransactionActionV1 + return ret + } + + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value +// and a boolean to check if the value has been set. +func (o *FullBlockTransactionEventV1) GetActionsOk() ([]FullBlockTransactionActionV1, bool) { + if o == nil { + return nil, false + } + return o.Actions, true +} + +// SetActions sets field value +func (o *FullBlockTransactionEventV1) SetActions(v []FullBlockTransactionActionV1) { + o.Actions = v +} + +func (o FullBlockTransactionEventV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FullBlockTransactionEventV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hash"] = o.Hash + toSerialize["channelId"] = o.ChannelId + toSerialize["timestamp"] = o.Timestamp + toSerialize["protocolVersion"] = o.ProtocolVersion + toSerialize["transactionType"] = o.TransactionType + toSerialize["epoch"] = o.Epoch + toSerialize["actions"] = o.Actions + return toSerialize, nil +} + +type NullableFullBlockTransactionEventV1 struct { + value *FullBlockTransactionEventV1 + isSet bool +} + +func (v NullableFullBlockTransactionEventV1) Get() *FullBlockTransactionEventV1 { + return v.value +} + +func (v *NullableFullBlockTransactionEventV1) Set(val *FullBlockTransactionEventV1) { + v.value = val + v.isSet = true +} + +func (v NullableFullBlockTransactionEventV1) IsSet() bool { + return v.isSet +} + +func (v *NullableFullBlockTransactionEventV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFullBlockTransactionEventV1(val *FullBlockTransactionEventV1) *NullableFullBlockTransactionEventV1 { + return &NullableFullBlockTransactionEventV1{value: val, isSet: true} +} + +func (v NullableFullBlockTransactionEventV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFullBlockTransactionEventV1) 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..16024033a63 --- /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: 2.0.0-rc.3 +*/ + +// 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..d9834f7880c --- /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: 2.0.0-rc.3 +*/ + +// 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..7365bee33d6 --- /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: 2.0.0-rc.3 +*/ + +// 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..016a91ca35a --- /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: 2.0.0-rc.3 +*/ + +// 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..23d71e7394a --- /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,249 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// 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"` + ResponseType *GetBlockResponseTypeV1 `json:"responseType,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 responseType GetBlockResponseTypeV1 = Full + this.ResponseType = &responseType + 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 responseType GetBlockResponseTypeV1 = Full + this.ResponseType = &responseType + 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 +} + +// GetResponseType returns the ResponseType field value if set, zero value otherwise. +func (o *GetBlockRequestV1) GetResponseType() GetBlockResponseTypeV1 { + if o == nil || IsNil(o.ResponseType) { + var ret GetBlockResponseTypeV1 + 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 *GetBlockRequestV1) GetResponseTypeOk() (*GetBlockResponseTypeV1, 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 *GetBlockRequestV1) HasResponseType() bool { + if o != nil && !IsNil(o.ResponseType) { + return true + } + + return false +} + +// SetResponseType gets a reference to the given GetBlockResponseTypeV1 and assigns it to the ResponseType field. +func (o *GetBlockRequestV1) SetResponseType(v GetBlockResponseTypeV1) { + o.ResponseType = &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.ResponseType) { + toSerialize["responseType"] = o.ResponseType + } + 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..1b52f77c460 --- /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: 2.0.0-rc.3 +*/ + +// 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..2f9bfb7ff61 --- /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: 2.0.0-rc.3 +*/ + +// 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..a4e8e9ace6a --- /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: 2.0.0-rc.3 +*/ + +// 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..57a9660424c --- /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: 2.0.0-rc.3 +*/ + +// 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_type_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_type_v1.go new file mode 100644 index 00000000000..e1e3942da1c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_block_response_type_v1.go @@ -0,0 +1,115 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" + "fmt" +) + +// GetBlockResponseTypeV1 Response type from GetBlock. +type GetBlockResponseTypeV1 string + +// List of GetBlockResponseTypeV1 +const ( + Full GetBlockResponseTypeV1 = "full" + Encoded GetBlockResponseTypeV1 = "encoded" + CactiTransactions GetBlockResponseTypeV1 = "cacti:transactions" + CactiFullBlock GetBlockResponseTypeV1 = "cacti:full-block" +) + +// All allowed values of GetBlockResponseTypeV1 enum +var AllowedGetBlockResponseTypeV1EnumValues = []GetBlockResponseTypeV1{ + "full", + "encoded", + "cacti:transactions", + "cacti:full-block", +} + +func (v *GetBlockResponseTypeV1) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GetBlockResponseTypeV1(value) + for _, existing := range AllowedGetBlockResponseTypeV1EnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GetBlockResponseTypeV1", value) +} + +// NewGetBlockResponseTypeV1FromValue returns a pointer to a valid GetBlockResponseTypeV1 +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGetBlockResponseTypeV1FromValue(v string) (*GetBlockResponseTypeV1, error) { + ev := GetBlockResponseTypeV1(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GetBlockResponseTypeV1: valid values are %v", v, AllowedGetBlockResponseTypeV1EnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GetBlockResponseTypeV1) IsValid() bool { + for _, existing := range AllowedGetBlockResponseTypeV1EnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetBlockResponseTypeV1 value +func (v GetBlockResponseTypeV1) Ptr() *GetBlockResponseTypeV1 { + return &v +} + +type NullableGetBlockResponseTypeV1 struct { + value *GetBlockResponseTypeV1 + isSet bool +} + +func (v NullableGetBlockResponseTypeV1) Get() *GetBlockResponseTypeV1 { + return v.value +} + +func (v *NullableGetBlockResponseTypeV1) Set(val *GetBlockResponseTypeV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetBlockResponseTypeV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBlockResponseTypeV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBlockResponseTypeV1(val *GetBlockResponseTypeV1) *NullableGetBlockResponseTypeV1 { + return &NullableGetBlockResponseTypeV1{value: val, isSet: true} +} + +func (v NullableGetBlockResponseTypeV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBlockResponseTypeV1) 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..8643091ac7d --- /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,208 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 { + CactiBlockFullResponseV1 *CactiBlockFullResponseV1 + CactiBlockTransactionsResponseV1 *CactiBlockTransactionsResponseV1 + GetBlockResponseDecodedV1 *GetBlockResponseDecodedV1 + GetBlockResponseEncodedV1 *GetBlockResponseEncodedV1 +} + +// CactiBlockFullResponseV1AsGetBlockResponseV1 is a convenience function that returns CactiBlockFullResponseV1 wrapped in GetBlockResponseV1 +func CactiBlockFullResponseV1AsGetBlockResponseV1(v *CactiBlockFullResponseV1) GetBlockResponseV1 { + return GetBlockResponseV1{ + CactiBlockFullResponseV1: v, + } +} + +// CactiBlockTransactionsResponseV1AsGetBlockResponseV1 is a convenience function that returns CactiBlockTransactionsResponseV1 wrapped in GetBlockResponseV1 +func CactiBlockTransactionsResponseV1AsGetBlockResponseV1(v *CactiBlockTransactionsResponseV1) GetBlockResponseV1 { + return GetBlockResponseV1{ + CactiBlockTransactionsResponseV1: v, + } +} + +// 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 CactiBlockFullResponseV1 + err = newStrictDecoder(data).Decode(&dst.CactiBlockFullResponseV1) + if err == nil { + jsonCactiBlockFullResponseV1, _ := json.Marshal(dst.CactiBlockFullResponseV1) + if string(jsonCactiBlockFullResponseV1) == "{}" { // empty struct + dst.CactiBlockFullResponseV1 = nil + } else { + match++ + } + } else { + dst.CactiBlockFullResponseV1 = nil + } + + // try to unmarshal data into CactiBlockTransactionsResponseV1 + err = newStrictDecoder(data).Decode(&dst.CactiBlockTransactionsResponseV1) + if err == nil { + jsonCactiBlockTransactionsResponseV1, _ := json.Marshal(dst.CactiBlockTransactionsResponseV1) + if string(jsonCactiBlockTransactionsResponseV1) == "{}" { // empty struct + dst.CactiBlockTransactionsResponseV1 = nil + } else { + match++ + } + } else { + dst.CactiBlockTransactionsResponseV1 = nil + } + + // 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.CactiBlockFullResponseV1 = nil + dst.CactiBlockTransactionsResponseV1 = 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.CactiBlockFullResponseV1 != nil { + return json.Marshal(&src.CactiBlockFullResponseV1) + } + + if src.CactiBlockTransactionsResponseV1 != nil { + return json.Marshal(&src.CactiBlockTransactionsResponseV1) + } + + 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.CactiBlockFullResponseV1 != nil { + return obj.CactiBlockFullResponseV1 + } + + if obj.CactiBlockTransactionsResponseV1 != nil { + return obj.CactiBlockTransactionsResponseV1 + } + + 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_chain_info_request_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_chain_info_request_v1.go new file mode 100644 index 00000000000..1e9302f533d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_chain_info_request_v1.go @@ -0,0 +1,182 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetChainInfoRequestV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetChainInfoRequestV1{} + +// GetChainInfoRequestV1 Request for GetChainInfo endpoint. +type GetChainInfoRequestV1 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"` +} + +// NewGetChainInfoRequestV1 instantiates a new GetChainInfoRequestV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetChainInfoRequestV1(channelName string, gatewayOptions GatewayOptions) *GetChainInfoRequestV1 { + this := GetChainInfoRequestV1{} + this.ChannelName = channelName + this.GatewayOptions = gatewayOptions + return &this +} + +// NewGetChainInfoRequestV1WithDefaults instantiates a new GetChainInfoRequestV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetChainInfoRequestV1WithDefaults() *GetChainInfoRequestV1 { + this := GetChainInfoRequestV1{} + return &this +} + +// GetChannelName returns the ChannelName field value +func (o *GetChainInfoRequestV1) 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 *GetChainInfoRequestV1) GetChannelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelName, true +} + +// SetChannelName sets field value +func (o *GetChainInfoRequestV1) SetChannelName(v string) { + o.ChannelName = v +} + +// GetConnectionChannelName returns the ConnectionChannelName field value if set, zero value otherwise. +func (o *GetChainInfoRequestV1) 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 *GetChainInfoRequestV1) 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 *GetChainInfoRequestV1) 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 *GetChainInfoRequestV1) SetConnectionChannelName(v string) { + o.ConnectionChannelName = &v +} + +// GetGatewayOptions returns the GatewayOptions field value +func (o *GetChainInfoRequestV1) 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 *GetChainInfoRequestV1) GetGatewayOptionsOk() (*GatewayOptions, bool) { + if o == nil { + return nil, false + } + return &o.GatewayOptions, true +} + +// SetGatewayOptions sets field value +func (o *GetChainInfoRequestV1) SetGatewayOptions(v GatewayOptions) { + o.GatewayOptions = v +} + +func (o GetChainInfoRequestV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetChainInfoRequestV1) 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 + return toSerialize, nil +} + +type NullableGetChainInfoRequestV1 struct { + value *GetChainInfoRequestV1 + isSet bool +} + +func (v NullableGetChainInfoRequestV1) Get() *GetChainInfoRequestV1 { + return v.value +} + +func (v *NullableGetChainInfoRequestV1) Set(val *GetChainInfoRequestV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetChainInfoRequestV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetChainInfoRequestV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetChainInfoRequestV1(val *GetChainInfoRequestV1) *NullableGetChainInfoRequestV1 { + return &NullableGetChainInfoRequestV1{value: val, isSet: true} +} + +func (v NullableGetChainInfoRequestV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetChainInfoRequestV1) 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_chain_info_response_v1.go b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_chain_info_response_v1.go new file mode 100644 index 00000000000..8bbc9857f5b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_get_chain_info_response_v1.go @@ -0,0 +1,174 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-fabric + +import ( + "encoding/json" +) + +// checks if the GetChainInfoResponseV1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetChainInfoResponseV1{} + +// GetChainInfoResponseV1 Response from GetChainInfo endpoint. +type GetChainInfoResponseV1 struct { + // Current height of fabric ledger + Height float32 `json:"height"` + // Current block hash of fabric ledger + CurrentBlockHash string `json:"currentBlockHash"` + // Previous block hash of fabric ledger + PreviousBlockHash string `json:"previousBlockHash"` +} + +// NewGetChainInfoResponseV1 instantiates a new GetChainInfoResponseV1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetChainInfoResponseV1(height float32, currentBlockHash string, previousBlockHash string) *GetChainInfoResponseV1 { + this := GetChainInfoResponseV1{} + this.Height = height + this.CurrentBlockHash = currentBlockHash + this.PreviousBlockHash = previousBlockHash + return &this +} + +// NewGetChainInfoResponseV1WithDefaults instantiates a new GetChainInfoResponseV1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetChainInfoResponseV1WithDefaults() *GetChainInfoResponseV1 { + this := GetChainInfoResponseV1{} + return &this +} + +// GetHeight returns the Height field value +func (o *GetChainInfoResponseV1) 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 *GetChainInfoResponseV1) GetHeightOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Height, true +} + +// SetHeight sets field value +func (o *GetChainInfoResponseV1) SetHeight(v float32) { + o.Height = v +} + +// GetCurrentBlockHash returns the CurrentBlockHash field value +func (o *GetChainInfoResponseV1) GetCurrentBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.CurrentBlockHash +} + +// GetCurrentBlockHashOk returns a tuple with the CurrentBlockHash field value +// and a boolean to check if the value has been set. +func (o *GetChainInfoResponseV1) GetCurrentBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CurrentBlockHash, true +} + +// SetCurrentBlockHash sets field value +func (o *GetChainInfoResponseV1) SetCurrentBlockHash(v string) { + o.CurrentBlockHash = v +} + +// GetPreviousBlockHash returns the PreviousBlockHash field value +func (o *GetChainInfoResponseV1) GetPreviousBlockHash() string { + if o == nil { + var ret string + return ret + } + + return o.PreviousBlockHash +} + +// GetPreviousBlockHashOk returns a tuple with the PreviousBlockHash field value +// and a boolean to check if the value has been set. +func (o *GetChainInfoResponseV1) GetPreviousBlockHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreviousBlockHash, true +} + +// SetPreviousBlockHash sets field value +func (o *GetChainInfoResponseV1) SetPreviousBlockHash(v string) { + o.PreviousBlockHash = v +} + +func (o GetChainInfoResponseV1) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetChainInfoResponseV1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["height"] = o.Height + toSerialize["currentBlockHash"] = o.CurrentBlockHash + toSerialize["previousBlockHash"] = o.PreviousBlockHash + return toSerialize, nil +} + +type NullableGetChainInfoResponseV1 struct { + value *GetChainInfoResponseV1 + isSet bool +} + +func (v NullableGetChainInfoResponseV1) Get() *GetChainInfoResponseV1 { + return v.value +} + +func (v *NullableGetChainInfoResponseV1) Set(val *GetChainInfoResponseV1) { + v.value = val + v.isSet = true +} + +func (v NullableGetChainInfoResponseV1) IsSet() bool { + return v.isSet +} + +func (v *NullableGetChainInfoResponseV1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetChainInfoResponseV1(val *GetChainInfoResponseV1) *NullableGetChainInfoResponseV1 { + return &NullableGetChainInfoResponseV1{value: val, isSet: true} +} + +func (v NullableGetChainInfoResponseV1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetChainInfoResponseV1) 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..700f0e6b825 --- /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: 2.0.0-rc.3 +*/ + +// 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..6ebf669624d --- /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: 2.0.0-rc.3 +*/ + +// 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..8503598e7bc --- /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: 2.0.0-rc.3 +*/ + +// 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..b4410b52f8d --- /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: 2.0.0-rc.3 +*/ + +// 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..a9bd6ecb1ac --- /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: 2.0.0-rc.3 +*/ + +// 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..2ded689c727 --- /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: 2.0.0-rc.3 +*/ + +// 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..80dc7f4b2e0 --- /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: 2.0.0-rc.3 +*/ + +// 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..51a242ba981 --- /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: 2.0.0-rc.3 +*/ + +// 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..12e1d7f3d6b --- /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: 2.0.0-rc.3 +*/ + +// 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..7c68070ffd1 --- /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: 2.0.0-rc.3 +*/ + +// 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..73de164c891 --- /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: 2.0.0-rc.3 +*/ + +// 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..7d95db94a1e --- /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: 2.0.0-rc.1 +*/ + +// 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..3e8dcf79ece --- /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: 2.0.0-rc.1 +*/ + +// 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..b2ddc67d309 --- /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: 2.0.0-rc.3 +*/ + +// 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..36354058791 --- /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: 2.0.0-rc.3 +*/ + +// 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..4bc52aee1b3 --- /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: 2.0.0-rc.3 +*/ + +// 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..2cc017683f7 --- /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,117 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// 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. 'Cacti*' 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" + CactiTransactions WatchBlocksListenerTypeV1 = "cacti:transactions" + CactiFullBlock WatchBlocksListenerTypeV1 = "cacti:full-block" +) + +// All allowed values of WatchBlocksListenerTypeV1 enum +var AllowedWatchBlocksListenerTypeV1EnumValues = []WatchBlocksListenerTypeV1{ + "filtered", + "full", + "private", + "cacti:transactions", + "cacti:full-block", +} + +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..e6f1e3ea6e1 --- /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: 2.0.0-rc.3 +*/ + +// 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..535174a0feb --- /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: 2.0.0-rc.3 +*/ + +// 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..dc753d7988d --- /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,268 @@ +/* +Hyperledger Cactus Plugin - Connector Fabric + +Can perform basic tasks on a fabric ledger + +API version: 2.0.0-rc.3 +*/ + +// 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 { + CactiBlockFullResponseV1 *CactiBlockFullResponseV1 + CactiBlockTransactionsResponseV1 *CactiBlockTransactionsResponseV1 + WatchBlocksCactusErrorResponseV1 *WatchBlocksCactusErrorResponseV1 + WatchBlocksFilteredResponseV1 *WatchBlocksFilteredResponseV1 + WatchBlocksFullResponseV1 *WatchBlocksFullResponseV1 + WatchBlocksPrivateResponseV1 *WatchBlocksPrivateResponseV1 +} + +// CactiBlockFullResponseV1AsWatchBlocksResponseV1 is a convenience function that returns CactiBlockFullResponseV1 wrapped in WatchBlocksResponseV1 +func CactiBlockFullResponseV1AsWatchBlocksResponseV1(v *CactiBlockFullResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + CactiBlockFullResponseV1: v, + } +} + +// CactiBlockTransactionsResponseV1AsWatchBlocksResponseV1 is a convenience function that returns CactiBlockTransactionsResponseV1 wrapped in WatchBlocksResponseV1 +func CactiBlockTransactionsResponseV1AsWatchBlocksResponseV1(v *CactiBlockTransactionsResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + CactiBlockTransactionsResponseV1: v, + } +} + +// WatchBlocksCactusErrorResponseV1AsWatchBlocksResponseV1 is a convenience function that returns WatchBlocksCactusErrorResponseV1 wrapped in WatchBlocksResponseV1 +func WatchBlocksCactusErrorResponseV1AsWatchBlocksResponseV1(v *WatchBlocksCactusErrorResponseV1) WatchBlocksResponseV1 { + return WatchBlocksResponseV1{ + WatchBlocksCactusErrorResponseV1: 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 CactiBlockFullResponseV1 + err = newStrictDecoder(data).Decode(&dst.CactiBlockFullResponseV1) + if err == nil { + jsonCactiBlockFullResponseV1, _ := json.Marshal(dst.CactiBlockFullResponseV1) + if string(jsonCactiBlockFullResponseV1) == "{}" { // empty struct + dst.CactiBlockFullResponseV1 = nil + } else { + match++ + } + } else { + dst.CactiBlockFullResponseV1 = nil + } + + // try to unmarshal data into CactiBlockTransactionsResponseV1 + err = newStrictDecoder(data).Decode(&dst.CactiBlockTransactionsResponseV1) + if err == nil { + jsonCactiBlockTransactionsResponseV1, _ := json.Marshal(dst.CactiBlockTransactionsResponseV1) + if string(jsonCactiBlockTransactionsResponseV1) == "{}" { // empty struct + dst.CactiBlockTransactionsResponseV1 = nil + } else { + match++ + } + } else { + dst.CactiBlockTransactionsResponseV1 = nil + } + + // 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 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.CactiBlockFullResponseV1 = nil + dst.CactiBlockTransactionsResponseV1 = nil + dst.WatchBlocksCactusErrorResponseV1 = 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.CactiBlockFullResponseV1 != nil { + return json.Marshal(&src.CactiBlockFullResponseV1) + } + + if src.CactiBlockTransactionsResponseV1 != nil { + return json.Marshal(&src.CactiBlockTransactionsResponseV1) + } + + if src.WatchBlocksCactusErrorResponseV1 != nil { + return json.Marshal(&src.WatchBlocksCactusErrorResponseV1) + } + + 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.CactiBlockFullResponseV1 != nil { + return obj.CactiBlockFullResponseV1 + } + + if obj.CactiBlockTransactionsResponseV1 != nil { + return obj.CactiBlockTransactionsResponseV1 + } + + if obj.WatchBlocksCactusErrorResponseV1 != nil { + return obj.WatchBlocksCactusErrorResponseV1 + } + + 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..4ec6856d0cf --- /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: 2.0.0-rc.3 +*/ + +// 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..22675ac9e92 --- /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: 2.0.0-rc.3 +*/ + +// 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..5660fa0c1a4 --- /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: 2.0.0-rc.3 +*/ + +// 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..93db63f980e --- /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: 2.0.0-rc.3 +*/ + +// 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-iroha2/package.json b/packages/cactus-plugin-ledger-connector-iroha2/package.json index f2fd3f68d49..31e71536032 100644 --- a/packages/cactus-plugin-ledger-connector-iroha2/package.json +++ b/packages/cactus-plugin-ledger-connector-iroha2/package.json @@ -40,9 +40,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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" }, "dependencies": { 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..a126a8d17a8 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-iroha2/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,39 @@ +.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 +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..2d8901eaef0 --- /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: 2.0.0-rc.3 +- 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..87e9e6db7fe --- /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: 2.0.0-rc.3 +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..0a7eb3da7ca --- /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: 2.0.0-rc.3 +*/ + +// 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..83b591b56d7 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..ed92a00911f --- /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: 2.0.0-rc.3 +*/ + +// 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..25160d325b4 --- /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: 2.0.0-rc.3 +*/ + +// 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..752acc956ca --- /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: 2.0.0-rc.3 +*/ + +// 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..bf4bd366164 --- /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: 2.0.0-rc.3 +*/ + +// 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..7b7412581d8 --- /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: 2.0.0-rc.3 +*/ + +// 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..ddef61f7bf6 --- /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: 2.0.0-rc.3 +*/ + +// 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..3340ec15fa7 --- /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: 2.0.0-rc.3 +*/ + +// 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..36edfd4d2ef --- /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: 2.0.0-rc.3 +*/ + +// 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..a1c6720c2a3 --- /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: 2.0.0-rc.3 +*/ + +// 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..d6edd4972e4 --- /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: 2.0.0-rc.3 +*/ + +// 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..109601da858 --- /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: 2.0.0-rc.3 +*/ + +// 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..9f714ec7473 --- /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: 2.0.0-rc.3 +*/ + +// 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..896efb8ae71 --- /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: 2.0.0-rc.3 +*/ + +// 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..6662b69b543 --- /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: 2.0.0-rc.3 +*/ + +// 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..21a211728c4 --- /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: 2.0.0-rc.3 +*/ + +// 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..6a373181471 --- /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: 2.0.0-rc.3 +*/ + +// 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..f2c1397b374 --- /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: 2.0.0-rc.3 +*/ + +// 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..25391ab5f8e --- /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: 2.0.0-rc.3 +*/ + +// 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..d0407ad2ebe --- /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: 2.0.0-rc.3 +*/ + +// 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..0e032b97cdc --- /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: 2.0.0-rc.3 +*/ + +// 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..d56f8e8e26f --- /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: 2.0.0-rc.3 +*/ + +// 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..fc0dd3b0f6c --- /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: 2.0.0-rc.3 +*/ + +// 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..ee5f934c536 --- /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: 2.0.0-rc.3 +*/ + +// 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..a4990293539 --- /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: 2.0.0-rc.3 +*/ + +// 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..83673d7cb83 --- /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: 2.0.0-rc.3 +*/ + +// 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..fab20a19098 --- /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: 2.0.0-rc.3 +*/ + +// 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..e4dab0f6d80 --- /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: 2.0.0-rc.3 +*/ + +// 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..ed6aa2709c7 --- /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: 2.0.0-rc.3 +*/ + +// 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..409e2fd15eb --- /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: 2.0.0-rc.3 +*/ + +// 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..29dc076db08 --- /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: 2.0.0-rc.3 +*/ + +// 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..5e033b323da --- /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: 2.0.0-rc.3 +*/ + +// 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..cb1ba453661 --- /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: 2.0.0-rc.3 +*/ + +// 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-polkadot/package.json b/packages/cactus-plugin-ledger-connector-polkadot/package.json index aa1df0bb6ed..f2e100b885c 100644 --- a/packages/cactus-plugin-ledger-connector-polkadot/package.json +++ b/packages/cactus-plugin-ledger-connector-polkadot/package.json @@ -48,9 +48,11 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s '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: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: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", "lint": "tslint tests/*.ts -t verbose", "lint-fix": "tslint --fix tests/*.ts -t verbose", "watch": "npm-watch", diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..7a30c613513 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/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_deploy_contract_ink_request.go +model_deploy_contract_ink_request_balance.go +model_deploy_contract_ink_request_gas_limit.go +model_deploy_contract_ink_request_salt.go +model_deploy_contract_ink_request_storage_deposit_limit.go +model_deploy_contract_ink_response.go +model_error_exception_response.go +model_invoke_contract_request.go +model_invoke_contract_response.go +model_polkadot_contract_invocation_type.go +model_polkadot_transaction_config.go +model_polkadot_transaction_config_transfer_submittable.go +model_polkadot_transaction_config_value.go +model_raw_transaction_request.go +model_raw_transaction_response.go +model_raw_transaction_response_data.go +model_raw_transaction_response_response_container.go +model_run_transaction_request.go +model_run_transaction_response.go +model_sign_raw_transaction_request.go +model_sign_raw_transaction_response.go +model_transaction_info_request.go +model_transaction_info_response.go +model_transaction_info_response_data.go +model_transaction_info_response_response_container.go +model_web3_signing_credential.go +model_web3_signing_credential_cactus_keychain_ref.go +model_web3_signing_credential_mnemonic_string.go +model_web3_signing_credential_none.go +model_web3_signing_credential_type.go +response.go +utils.go diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-ledger-connector-polkadot/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-polkadot/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-polkadot/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/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-polkadot/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..7d950f55022 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,147 @@ +# Go API client for cactus-plugin-ledger-connector-polkadot + +Can perform basic tasks on a Polkadot parachain + +## 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: 2.0.0-rc.3 +- 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-polkadot "github.com/hyperledger/cactus-plugin-ledger-connector-polkadot/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-polkadot.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-polkadot.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-polkadot.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-ledger-connector-polkadot.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* | [**DeployContractInk**](docs/DefaultApi.md#deploycontractink) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/deploy-contract-ink | Deploys the ink! contract +*DefaultApi* | [**GetPrometheusMetrics**](docs/DefaultApi.md#getprometheusmetrics) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-prometheus-exporter-metrics | Get the Prometheus Metrics +*DefaultApi* | [**GetRawTransaction**](docs/DefaultApi.md#getrawtransaction) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-raw-transaction | Get raw unsigned transaction +*DefaultApi* | [**GetTransactionInfo**](docs/DefaultApi.md#gettransactioninfo) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-transaction-info | Get the necessary Transaction Info for a account +*DefaultApi* | [**InvokeContract**](docs/DefaultApi.md#invokecontract) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/invoke-contract | Invokes a contract on a polkadot ledger +*DefaultApi* | [**RunTransaction**](docs/DefaultApi.md#runtransaction) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/run-transaction | Executes a transaction on a Polkadot ledger +*DefaultApi* | [**SignRawTransaction**](docs/DefaultApi.md#signrawtransaction) | **Post** /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/sign-raw-transaction | sign the raw transaction + + +## Documentation For Models + + - [DeployContractInkRequest](docs/DeployContractInkRequest.md) + - [DeployContractInkRequestBalance](docs/DeployContractInkRequestBalance.md) + - [DeployContractInkRequestGasLimit](docs/DeployContractInkRequestGasLimit.md) + - [DeployContractInkRequestSalt](docs/DeployContractInkRequestSalt.md) + - [DeployContractInkRequestStorageDepositLimit](docs/DeployContractInkRequestStorageDepositLimit.md) + - [DeployContractInkResponse](docs/DeployContractInkResponse.md) + - [ErrorExceptionResponse](docs/ErrorExceptionResponse.md) + - [InvokeContractRequest](docs/InvokeContractRequest.md) + - [InvokeContractResponse](docs/InvokeContractResponse.md) + - [PolkadotContractInvocationType](docs/PolkadotContractInvocationType.md) + - [PolkadotTransactionConfig](docs/PolkadotTransactionConfig.md) + - [PolkadotTransactionConfigTransferSubmittable](docs/PolkadotTransactionConfigTransferSubmittable.md) + - [PolkadotTransactionConfigValue](docs/PolkadotTransactionConfigValue.md) + - [RawTransactionRequest](docs/RawTransactionRequest.md) + - [RawTransactionResponse](docs/RawTransactionResponse.md) + - [RawTransactionResponseData](docs/RawTransactionResponseData.md) + - [RawTransactionResponseResponseContainer](docs/RawTransactionResponseResponseContainer.md) + - [RunTransactionRequest](docs/RunTransactionRequest.md) + - [RunTransactionResponse](docs/RunTransactionResponse.md) + - [SignRawTransactionRequest](docs/SignRawTransactionRequest.md) + - [SignRawTransactionResponse](docs/SignRawTransactionResponse.md) + - [TransactionInfoRequest](docs/TransactionInfoRequest.md) + - [TransactionInfoResponse](docs/TransactionInfoResponse.md) + - [TransactionInfoResponseData](docs/TransactionInfoResponseData.md) + - [TransactionInfoResponseResponseContainer](docs/TransactionInfoResponseResponseContainer.md) + - [Web3SigningCredential](docs/Web3SigningCredential.md) + - [Web3SigningCredentialCactusKeychainRef](docs/Web3SigningCredentialCactusKeychainRef.md) + - [Web3SigningCredentialMnemonicString](docs/Web3SigningCredentialMnemonicString.md) + - [Web3SigningCredentialNone](docs/Web3SigningCredentialNone.md) + - [Web3SigningCredentialType](docs/Web3SigningCredentialType.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-polkadot/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..a8db36f1ca7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,700 @@ +openapi: 3.0.3 +info: + description: Can perform basic tasks on a Polkadot parachain + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: Hyperledger Cactus Plugin - Connector Polkadot + version: 2.0.0-rc.3 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-prometheus-exporter-metrics: + get: + operationId: getPrometheusMetrics + parameters: [] + responses: + "200": + content: + text/plain: + schema: + $ref: '#/components/schemas/PrometheusExporterMetricsResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponse' + description: Internal Server Error + summary: Get the Prometheus Metrics + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-prometheus-exporter-metrics + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-transaction-info: + post: + operationId: getTransactionInfo + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TransactionInfoRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TransactionInfoResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponse' + description: Internal Server Error + summary: Get the necessary Transaction Info for a account + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-transaction-info + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-raw-transaction: + post: + operationId: getRawTransaction + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RawTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RawTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponse' + description: Internal Server Error + summary: Get raw unsigned transaction + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-raw-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/sign-raw-transaction: + post: + operationId: signRawTransaction + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SignRawTransactionRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/SignRawTransactionResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponse' + description: Internal Server Error + summary: sign the raw transaction + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/sign-raw-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/run-transaction: + post: + operationId: runTransaction + 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/ErrorExceptionResponse' + description: Internal Server Error + summary: Executes a transaction on a Polkadot ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/run-transaction + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/deploy-contract-ink: + post: + operationId: deployContractInk + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractInkRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DeployContractInkResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponse' + description: Internal Server Error + summary: Deploys the ink! contract + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/deploy-contract-ink + /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/invoke-contract: + post: + operationId: invokeContract + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/InvokeContractResponse' + description: OK + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorExceptionResponse' + description: Internal Server Error + summary: Invokes a contract on a polkadot ledger + x-hyperledger-cacti: + http: + verbLowerCase: post + path: /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/invoke-contract +components: + schemas: + PrometheusExporterMetricsResponse: + nullable: false + type: string + TransactionInfoRequest: + additionalProperties: false + example: + transactionExpiration: 0.8008281904610115 + accountAddress: accountAddress + properties: + accountAddress: + nullable: false + type: string + transactionExpiration: + nullable: true + type: number + required: + - accountAddress + - transactionExpiration + type: object + TransactionInfoResponseData: + additionalProperties: false + example: + blockHash: "{}" + era: "{}" + nonce: "{}" + properties: + nonce: + nullable: false + type: object + blockHash: + nullable: false + type: object + era: + nullable: true + type: object + required: + - blockHash + - era + - nonce + type: object + TransactionInfoResponse: + additionalProperties: false + example: + responseContainer: + response_data: + blockHash: "{}" + era: "{}" + nonce: "{}" + message: message + error: error + succeeded: true + properties: + responseContainer: + $ref: '#/components/schemas/TransactionInfoResponse_responseContainer' + required: + - responseContainer + type: object + RawTransactionRequest: + additionalProperties: false + example: + to: to + value: 0.8008281904610115 + properties: + to: + nullable: false + type: string + value: + nullable: false + type: number + required: + - to + - value + type: object + RawTransactionResponseData: + additionalProperties: false + example: + rawTransaction: rawTransaction + properties: + rawTransaction: + nullable: false + type: string + required: + - rawTransaction + type: object + RawTransactionResponse: + additionalProperties: false + example: + responseContainer: + response_data: + rawTransaction: rawTransaction + message: message + error: error + succeeded: true + properties: + responseContainer: + $ref: '#/components/schemas/RawTransactionResponse_responseContainer' + required: + - responseContainer + type: object + SignRawTransactionRequest: + additionalProperties: false + example: + rawTransaction: rawTransaction + signingOptions: "{}" + mnemonic: mnemonic + properties: + rawTransaction: + nullable: false + type: string + mnemonic: + nullable: false + type: string + signingOptions: + nullable: false + type: object + required: + - mnemonic + - rawTransaction + type: object + SignRawTransactionResponse: + additionalProperties: false + example: + signedTransaction: signedTransaction + success: true + properties: + success: + nullable: false + type: boolean + signedTransaction: + nullable: false + type: string + required: + - signedTransaction + - success + type: object + web3SigningCredential: + discriminator: + propertyName: type + example: + type: null + oneOf: + - $ref: '#/components/schemas/Web3SigningCredentialCactusKeychainRef' + - $ref: '#/components/schemas/Web3SigningCredentialMnemonicString' + - $ref: '#/components/schemas/Web3SigningCredentialNone' + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + required: + - type + type: object + Web3SigningCredentialCactusKeychainRef: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + 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 + Web3SigningCredentialMnemonicString: + properties: + type: + $ref: '#/components/schemas/Web3SigningCredentialType' + mnemonic: + description: The Polkadot account's seed phrase for signing transaction + nullable: false + type: string + required: + - mnemonic + - 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 + - MNEMONIC_STRING + - NONE + type: string + PolkadotTransactionConfig: + additionalProperties: true + example: + transferSubmittable: null + to: null + value: null + properties: + transferSubmittable: + $ref: '#/components/schemas/PolkadotTransactionConfig_transferSubmittable' + to: + $ref: '#/components/schemas/PolkadotTransactionConfig_transferSubmittable' + value: + $ref: '#/components/schemas/PolkadotTransactionConfig_value' + type: object + RunTransactionRequest: + additionalProperties: false + example: + transactionConfig: + transferSubmittable: null + to: null + value: null + web3SigningCredential: + type: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/web3SigningCredential' + transactionConfig: + $ref: '#/components/schemas/PolkadotTransactionConfig' + required: + - transactionConfig + - web3SigningCredential + type: object + RunTransactionResponse: + additionalProperties: false + example: + blockHash: blockHash + success: true + txHash: txHash + properties: + success: + nullable: false + type: boolean + txHash: + nullable: false + type: string + blockHash: + nullable: false + type: string + required: + - success + type: object + DeployContractInkRequest: + additionalProperties: false + example: + gasLimit: + refTime: 0 + proofSize: 0 + metadata: null + wasm: wasm + salt: null + balance: null + web3SigningCredential: + type: null + storageDepositLimit: null + params: + - "" + - "" + constructorMethod: null + properties: + web3SigningCredential: + $ref: '#/components/schemas/web3SigningCredential' + wasm: + description: raw wasm for the compiled contract in base64 format + format: byte + nullable: false + type: string + constructorMethod: + $ref: '#/components/schemas/PolkadotTransactionConfig_transferSubmittable' + metadata: + $ref: '#/components/schemas/PolkadotTransactionConfig_transferSubmittable' + gasLimit: + $ref: '#/components/schemas/DeployContractInkRequest_gasLimit' + storageDepositLimit: + $ref: '#/components/schemas/DeployContractInkRequest_storageDepositLimit' + params: + default: [] + description: The list of arguments to pass in to the contract method being + deployed + items: {} + type: array + balance: + $ref: '#/components/schemas/DeployContractInkRequest_balance' + salt: + $ref: '#/components/schemas/DeployContractInkRequest_salt' + required: + - gasLimit + - metadata + - wasm + - web3SigningCredential + type: object + DeployContractInkResponse: + additionalProperties: false + example: + success: true + contractAddress: contractAddress + properties: + success: + nullable: false + type: boolean + contractAddress: + nullable: false + type: string + required: + - success + type: object + PolkadotContractInvocationType: + enum: + - SEND + - QUERY + type: string + InvokeContractRequest: + additionalProperties: false + example: + invocationType: null + gasLimit: + refTime: 0 + proofSize: 0 + metadata: null + balance: null + accountAddress: accountAddress + web3SigningCredential: + type: null + contractAddress: contractAddress + methodName: methodName + storageDepositLimit: null + params: + - "" + - "" + properties: + invocationType: + $ref: '#/components/schemas/PolkadotContractInvocationType' + accountAddress: + nullable: false + type: string + web3SigningCredential: + $ref: '#/components/schemas/web3SigningCredential' + metadata: + $ref: '#/components/schemas/PolkadotTransactionConfig_transferSubmittable' + contractAddress: + nullable: false + type: string + methodName: + description: The name of the contract method to invoke. + maxLength: 2048 + minLength: 1 + nullable: false + type: string + gasLimit: + $ref: '#/components/schemas/DeployContractInkRequest_gasLimit' + storageDepositLimit: + $ref: '#/components/schemas/DeployContractInkRequest_storageDepositLimit' + balance: + $ref: '#/components/schemas/DeployContractInkRequest_balance' + params: + default: [] + description: The list of arguments to pass in to the contract method being + invoked + items: {} + type: array + required: + - accountAddress + - contractAddress + - gasLimit + - invocationType + - metadata + - methodName + - web3SigningCredential + type: object + InvokeContractResponse: + example: + blockHash: blockHash + callOutput: "" + success: true + txHash: txHash + properties: + callOutput: {} + success: + nullable: false + type: boolean + txHash: + nullable: false + type: string + blockHash: + nullable: false + type: string + required: + - success + type: object + ErrorExceptionResponse: + 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 + TransactionInfoResponse_responseContainer: + additionalProperties: false + example: + response_data: + blockHash: "{}" + era: "{}" + nonce: "{}" + message: message + error: error + succeeded: true + properties: + response_data: + $ref: '#/components/schemas/TransactionInfoResponseData' + succeeded: + nullable: false + type: boolean + message: + nullable: false + type: string + error: + nullable: true + type: string + required: + - error + - message + - response_data + - succeeded + type: object + RawTransactionResponse_responseContainer: + additionalProperties: false + example: + response_data: + rawTransaction: rawTransaction + message: message + error: error + succeeded: true + properties: + response_data: + $ref: '#/components/schemas/RawTransactionResponseData' + succeeded: + nullable: false + type: boolean + message: + nullable: false + type: string + error: + nullable: true + type: string + required: + - error + - message + - response_data + - succeeded + type: object + PolkadotTransactionConfig_transferSubmittable: + oneOf: + - type: string + PolkadotTransactionConfig_value: + oneOf: + - type: number + DeployContractInkRequest_gasLimit: + example: + refTime: 0 + proofSize: 0 + properties: + refTime: + minimum: 0 + type: integer + proofSize: + minimum: 0 + type: integer + required: + - proofSize + - refTime + type: object + DeployContractInkRequest_storageDepositLimit: + nullable: true + oneOf: + - type: string + - minimum: 0 + type: integer + DeployContractInkRequest_balance: + oneOf: + - type: string + - minimum: 0 + type: integer + DeployContractInkRequest_salt: + nullable: true + oneOf: + - type: string diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..e65fcd21994 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,820 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DefaultApiService DefaultApi service +type DefaultApiService service + +type ApiDeployContractInkRequest struct { + ctx context.Context + ApiService *DefaultApiService + deployContractInkRequest *DeployContractInkRequest +} + +func (r ApiDeployContractInkRequest) DeployContractInkRequest(deployContractInkRequest DeployContractInkRequest) ApiDeployContractInkRequest { + r.deployContractInkRequest = &deployContractInkRequest + return r +} + +func (r ApiDeployContractInkRequest) Execute() (*DeployContractInkResponse, *http.Response, error) { + return r.ApiService.DeployContractInkExecute(r) +} + +/* +DeployContractInk Deploys the ink! contract + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDeployContractInkRequest +*/ +func (a *DefaultApiService) DeployContractInk(ctx context.Context) ApiDeployContractInkRequest { + return ApiDeployContractInkRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DeployContractInkResponse +func (a *DefaultApiService) DeployContractInkExecute(r ApiDeployContractInkRequest) (*DeployContractInkResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeployContractInkResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeployContractInk") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/deploy-contract-ink" + + 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.deployContractInkRequest + 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 ErrorExceptionResponse + 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 ApiGetPrometheusMetricsRequest struct { + ctx context.Context + ApiService *DefaultApiService +} + +func (r ApiGetPrometheusMetricsRequest) Execute() (string, *http.Response, error) { + return r.ApiService.GetPrometheusMetricsExecute(r) +} + +/* +GetPrometheusMetrics Get the Prometheus Metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPrometheusMetricsRequest +*/ +func (a *DefaultApiService) GetPrometheusMetrics(ctx context.Context) ApiGetPrometheusMetricsRequest { + return ApiGetPrometheusMetricsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return string +func (a *DefaultApiService) GetPrometheusMetricsExecute(r ApiGetPrometheusMetricsRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetPrometheusMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/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", "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 ErrorExceptionResponse + 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 ApiGetRawTransactionRequest struct { + ctx context.Context + ApiService *DefaultApiService + rawTransactionRequest *RawTransactionRequest +} + +func (r ApiGetRawTransactionRequest) RawTransactionRequest(rawTransactionRequest RawTransactionRequest) ApiGetRawTransactionRequest { + r.rawTransactionRequest = &rawTransactionRequest + return r +} + +func (r ApiGetRawTransactionRequest) Execute() (*RawTransactionResponse, *http.Response, error) { + return r.ApiService.GetRawTransactionExecute(r) +} + +/* +GetRawTransaction Get raw unsigned transaction + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRawTransactionRequest +*/ +func (a *DefaultApiService) GetRawTransaction(ctx context.Context) ApiGetRawTransactionRequest { + return ApiGetRawTransactionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RawTransactionResponse +func (a *DefaultApiService) GetRawTransactionExecute(r ApiGetRawTransactionRequest) (*RawTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RawTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetRawTransaction") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-raw-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.rawTransactionRequest + 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 ErrorExceptionResponse + 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 ApiGetTransactionInfoRequest struct { + ctx context.Context + ApiService *DefaultApiService + transactionInfoRequest *TransactionInfoRequest +} + +func (r ApiGetTransactionInfoRequest) TransactionInfoRequest(transactionInfoRequest TransactionInfoRequest) ApiGetTransactionInfoRequest { + r.transactionInfoRequest = &transactionInfoRequest + return r +} + +func (r ApiGetTransactionInfoRequest) Execute() (*TransactionInfoResponse, *http.Response, error) { + return r.ApiService.GetTransactionInfoExecute(r) +} + +/* +GetTransactionInfo Get the necessary Transaction Info for a account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionInfoRequest +*/ +func (a *DefaultApiService) GetTransactionInfo(ctx context.Context) ApiGetTransactionInfoRequest { + return ApiGetTransactionInfoRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return TransactionInfoResponse +func (a *DefaultApiService) GetTransactionInfoExecute(r ApiGetTransactionInfoRequest) (*TransactionInfoResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransactionInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetTransactionInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/get-transaction-info" + + 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.transactionInfoRequest + 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 ErrorExceptionResponse + 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 ApiInvokeContractRequest struct { + ctx context.Context + ApiService *DefaultApiService + invokeContractRequest *InvokeContractRequest +} + +func (r ApiInvokeContractRequest) InvokeContractRequest(invokeContractRequest InvokeContractRequest) ApiInvokeContractRequest { + r.invokeContractRequest = &invokeContractRequest + return r +} + +func (r ApiInvokeContractRequest) Execute() (*InvokeContractResponse, *http.Response, error) { + return r.ApiService.InvokeContractExecute(r) +} + +/* +InvokeContract Invokes a contract on a polkadot ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiInvokeContractRequest +*/ +func (a *DefaultApiService) InvokeContract(ctx context.Context) ApiInvokeContractRequest { + return ApiInvokeContractRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return InvokeContractResponse +func (a *DefaultApiService) InvokeContractExecute(r ApiInvokeContractRequest) (*InvokeContractResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvokeContractResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.InvokeContract") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/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.invokeContractRequest + 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 ErrorExceptionResponse + 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 ApiRunTransactionRequest struct { + ctx context.Context + ApiService *DefaultApiService + runTransactionRequest *RunTransactionRequest +} + +func (r ApiRunTransactionRequest) RunTransactionRequest(runTransactionRequest RunTransactionRequest) ApiRunTransactionRequest { + r.runTransactionRequest = &runTransactionRequest + return r +} + +func (r ApiRunTransactionRequest) Execute() (*RunTransactionResponse, *http.Response, error) { + return r.ApiService.RunTransactionExecute(r) +} + +/* +RunTransaction Executes a transaction on a Polkadot ledger + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRunTransactionRequest +*/ +func (a *DefaultApiService) RunTransaction(ctx context.Context) ApiRunTransactionRequest { + return ApiRunTransactionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RunTransactionResponse +func (a *DefaultApiService) RunTransactionExecute(r ApiRunTransactionRequest) (*RunTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.RunTransaction") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/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, + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorExceptionResponse + 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 ApiSignRawTransactionRequest struct { + ctx context.Context + ApiService *DefaultApiService + signRawTransactionRequest *SignRawTransactionRequest +} + +func (r ApiSignRawTransactionRequest) SignRawTransactionRequest(signRawTransactionRequest SignRawTransactionRequest) ApiSignRawTransactionRequest { + r.signRawTransactionRequest = &signRawTransactionRequest + return r +} + +func (r ApiSignRawTransactionRequest) Execute() (*SignRawTransactionResponse, *http.Response, error) { + return r.ApiService.SignRawTransactionExecute(r) +} + +/* +SignRawTransaction sign the raw transaction + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSignRawTransactionRequest +*/ +func (a *DefaultApiService) SignRawTransaction(ctx context.Context) ApiSignRawTransactionRequest { + return ApiSignRawTransactionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SignRawTransactionResponse +func (a *DefaultApiService) SignRawTransactionExecute(r ApiSignRawTransactionRequest) (*SignRawTransactionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SignRawTransactionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.SignRawTransaction") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-polkadot/sign-raw-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.signRawTransactionRequest + 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 ErrorExceptionResponse + 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-polkadot/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..8ea0e6be0eb --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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 Polkadot API v2.0.0-rc.3 +// 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-polkadot/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..371856bdf13 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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-polkadot/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..b221d145d6f --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/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-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request.go new file mode 100644 index 00000000000..d90429e53ec --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request.go @@ -0,0 +1,400 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the DeployContractInkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractInkRequest{} + +// DeployContractInkRequest struct for DeployContractInkRequest +type DeployContractInkRequest struct { + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + // raw wasm for the compiled contract in base64 format + Wasm string `json:"wasm"` + ConstructorMethod *PolkadotTransactionConfigTransferSubmittable `json:"constructorMethod,omitempty"` + Metadata PolkadotTransactionConfigTransferSubmittable `json:"metadata"` + GasLimit DeployContractInkRequestGasLimit `json:"gasLimit"` + StorageDepositLimit NullableDeployContractInkRequestStorageDepositLimit `json:"storageDepositLimit,omitempty"` + // The list of arguments to pass in to the contract method being deployed + Params []interface{} `json:"params,omitempty"` + Balance *DeployContractInkRequestBalance `json:"balance,omitempty"` + Salt NullableDeployContractInkRequestSalt `json:"salt,omitempty"` +} + +// NewDeployContractInkRequest instantiates a new DeployContractInkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractInkRequest(web3SigningCredential Web3SigningCredential, wasm string, metadata PolkadotTransactionConfigTransferSubmittable, gasLimit DeployContractInkRequestGasLimit) *DeployContractInkRequest { + this := DeployContractInkRequest{} + this.Web3SigningCredential = web3SigningCredential + this.Wasm = wasm + this.Metadata = metadata + this.GasLimit = gasLimit + return &this +} + +// NewDeployContractInkRequestWithDefaults instantiates a new DeployContractInkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractInkRequestWithDefaults() *DeployContractInkRequest { + this := DeployContractInkRequest{} + return &this +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *DeployContractInkRequest) 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 *DeployContractInkRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *DeployContractInkRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetWasm returns the Wasm field value +func (o *DeployContractInkRequest) GetWasm() string { + if o == nil { + var ret string + return ret + } + + return o.Wasm +} + +// GetWasmOk returns a tuple with the Wasm field value +// and a boolean to check if the value has been set. +func (o *DeployContractInkRequest) GetWasmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Wasm, true +} + +// SetWasm sets field value +func (o *DeployContractInkRequest) SetWasm(v string) { + o.Wasm = v +} + +// GetConstructorMethod returns the ConstructorMethod field value if set, zero value otherwise. +func (o *DeployContractInkRequest) GetConstructorMethod() PolkadotTransactionConfigTransferSubmittable { + if o == nil || IsNil(o.ConstructorMethod) { + var ret PolkadotTransactionConfigTransferSubmittable + return ret + } + return *o.ConstructorMethod +} + +// GetConstructorMethodOk returns a tuple with the ConstructorMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployContractInkRequest) GetConstructorMethodOk() (*PolkadotTransactionConfigTransferSubmittable, bool) { + if o == nil || IsNil(o.ConstructorMethod) { + return nil, false + } + return o.ConstructorMethod, true +} + +// HasConstructorMethod returns a boolean if a field has been set. +func (o *DeployContractInkRequest) HasConstructorMethod() bool { + if o != nil && !IsNil(o.ConstructorMethod) { + return true + } + + return false +} + +// SetConstructorMethod gets a reference to the given PolkadotTransactionConfigTransferSubmittable and assigns it to the ConstructorMethod field. +func (o *DeployContractInkRequest) SetConstructorMethod(v PolkadotTransactionConfigTransferSubmittable) { + o.ConstructorMethod = &v +} + +// GetMetadata returns the Metadata field value +func (o *DeployContractInkRequest) GetMetadata() PolkadotTransactionConfigTransferSubmittable { + if o == nil { + var ret PolkadotTransactionConfigTransferSubmittable + return ret + } + + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +func (o *DeployContractInkRequest) GetMetadataOk() (*PolkadotTransactionConfigTransferSubmittable, bool) { + if o == nil { + return nil, false + } + return &o.Metadata, true +} + +// SetMetadata sets field value +func (o *DeployContractInkRequest) SetMetadata(v PolkadotTransactionConfigTransferSubmittable) { + o.Metadata = v +} + +// GetGasLimit returns the GasLimit field value +func (o *DeployContractInkRequest) GetGasLimit() DeployContractInkRequestGasLimit { + if o == nil { + var ret DeployContractInkRequestGasLimit + 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 *DeployContractInkRequest) GetGasLimitOk() (*DeployContractInkRequestGasLimit, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *DeployContractInkRequest) SetGasLimit(v DeployContractInkRequestGasLimit) { + o.GasLimit = v +} + +// GetStorageDepositLimit returns the StorageDepositLimit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeployContractInkRequest) GetStorageDepositLimit() DeployContractInkRequestStorageDepositLimit { + if o == nil || IsNil(o.StorageDepositLimit.Get()) { + var ret DeployContractInkRequestStorageDepositLimit + return ret + } + return *o.StorageDepositLimit.Get() +} + +// GetStorageDepositLimitOk returns a tuple with the StorageDepositLimit 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 *DeployContractInkRequest) GetStorageDepositLimitOk() (*DeployContractInkRequestStorageDepositLimit, bool) { + if o == nil { + return nil, false + } + return o.StorageDepositLimit.Get(), o.StorageDepositLimit.IsSet() +} + +// HasStorageDepositLimit returns a boolean if a field has been set. +func (o *DeployContractInkRequest) HasStorageDepositLimit() bool { + if o != nil && o.StorageDepositLimit.IsSet() { + return true + } + + return false +} + +// SetStorageDepositLimit gets a reference to the given NullableDeployContractInkRequestStorageDepositLimit and assigns it to the StorageDepositLimit field. +func (o *DeployContractInkRequest) SetStorageDepositLimit(v DeployContractInkRequestStorageDepositLimit) { + o.StorageDepositLimit.Set(&v) +} +// SetStorageDepositLimitNil sets the value for StorageDepositLimit to be an explicit nil +func (o *DeployContractInkRequest) SetStorageDepositLimitNil() { + o.StorageDepositLimit.Set(nil) +} + +// UnsetStorageDepositLimit ensures that no value is present for StorageDepositLimit, not even an explicit nil +func (o *DeployContractInkRequest) UnsetStorageDepositLimit() { + o.StorageDepositLimit.Unset() +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *DeployContractInkRequest) 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 *DeployContractInkRequest) 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 *DeployContractInkRequest) 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 *DeployContractInkRequest) SetParams(v []interface{}) { + o.Params = v +} + +// GetBalance returns the Balance field value if set, zero value otherwise. +func (o *DeployContractInkRequest) GetBalance() DeployContractInkRequestBalance { + if o == nil || IsNil(o.Balance) { + var ret DeployContractInkRequestBalance + 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 *DeployContractInkRequest) GetBalanceOk() (*DeployContractInkRequestBalance, 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 *DeployContractInkRequest) HasBalance() bool { + if o != nil && !IsNil(o.Balance) { + return true + } + + return false +} + +// SetBalance gets a reference to the given DeployContractInkRequestBalance and assigns it to the Balance field. +func (o *DeployContractInkRequest) SetBalance(v DeployContractInkRequestBalance) { + o.Balance = &v +} + +// GetSalt returns the Salt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeployContractInkRequest) GetSalt() DeployContractInkRequestSalt { + if o == nil || IsNil(o.Salt.Get()) { + var ret DeployContractInkRequestSalt + return ret + } + return *o.Salt.Get() +} + +// GetSaltOk returns a tuple with the Salt 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 *DeployContractInkRequest) GetSaltOk() (*DeployContractInkRequestSalt, bool) { + if o == nil { + return nil, false + } + return o.Salt.Get(), o.Salt.IsSet() +} + +// HasSalt returns a boolean if a field has been set. +func (o *DeployContractInkRequest) HasSalt() bool { + if o != nil && o.Salt.IsSet() { + return true + } + + return false +} + +// SetSalt gets a reference to the given NullableDeployContractInkRequestSalt and assigns it to the Salt field. +func (o *DeployContractInkRequest) SetSalt(v DeployContractInkRequestSalt) { + o.Salt.Set(&v) +} +// SetSaltNil sets the value for Salt to be an explicit nil +func (o *DeployContractInkRequest) SetSaltNil() { + o.Salt.Set(nil) +} + +// UnsetSalt ensures that no value is present for Salt, not even an explicit nil +func (o *DeployContractInkRequest) UnsetSalt() { + o.Salt.Unset() +} + +func (o DeployContractInkRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractInkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["wasm"] = o.Wasm + if !IsNil(o.ConstructorMethod) { + toSerialize["constructorMethod"] = o.ConstructorMethod + } + toSerialize["metadata"] = o.Metadata + toSerialize["gasLimit"] = o.GasLimit + if o.StorageDepositLimit.IsSet() { + toSerialize["storageDepositLimit"] = o.StorageDepositLimit.Get() + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + if !IsNil(o.Balance) { + toSerialize["balance"] = o.Balance + } + if o.Salt.IsSet() { + toSerialize["salt"] = o.Salt.Get() + } + return toSerialize, nil +} + +type NullableDeployContractInkRequest struct { + value *DeployContractInkRequest + isSet bool +} + +func (v NullableDeployContractInkRequest) Get() *DeployContractInkRequest { + return v.value +} + +func (v *NullableDeployContractInkRequest) Set(val *DeployContractInkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractInkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractInkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractInkRequest(val *DeployContractInkRequest) *NullableDeployContractInkRequest { + return &NullableDeployContractInkRequest{value: val, isSet: true} +} + +func (v NullableDeployContractInkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractInkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_balance.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_balance.go new file mode 100644 index 00000000000..c835cef4dcc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_balance.go @@ -0,0 +1,148 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// DeployContractInkRequestBalance - struct for DeployContractInkRequestBalance +type DeployContractInkRequestBalance struct { + Int32 *int32 + String *string +} + +// int32AsDeployContractInkRequestBalance is a convenience function that returns int32 wrapped in DeployContractInkRequestBalance +func Int32AsDeployContractInkRequestBalance(v *int32) DeployContractInkRequestBalance { + return DeployContractInkRequestBalance{ + Int32: v, + } +} + +// stringAsDeployContractInkRequestBalance is a convenience function that returns string wrapped in DeployContractInkRequestBalance +func StringAsDeployContractInkRequestBalance(v *string) DeployContractInkRequestBalance { + return DeployContractInkRequestBalance{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *DeployContractInkRequestBalance) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Int32 + err = newStrictDecoder(data).Decode(&dst.Int32) + if err == nil { + jsonInt32, _ := json.Marshal(dst.Int32) + if string(jsonInt32) == "{}" { // empty struct + dst.Int32 = nil + } else { + match++ + } + } else { + dst.Int32 = 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.Int32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(DeployContractInkRequestBalance)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(DeployContractInkRequestBalance)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src DeployContractInkRequestBalance) MarshalJSON() ([]byte, error) { + if src.Int32 != nil { + return json.Marshal(&src.Int32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *DeployContractInkRequestBalance) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Int32 != nil { + return obj.Int32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableDeployContractInkRequestBalance struct { + value *DeployContractInkRequestBalance + isSet bool +} + +func (v NullableDeployContractInkRequestBalance) Get() *DeployContractInkRequestBalance { + return v.value +} + +func (v *NullableDeployContractInkRequestBalance) Set(val *DeployContractInkRequestBalance) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractInkRequestBalance) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractInkRequestBalance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractInkRequestBalance(val *DeployContractInkRequestBalance) *NullableDeployContractInkRequestBalance { + return &NullableDeployContractInkRequestBalance{value: val, isSet: true} +} + +func (v NullableDeployContractInkRequestBalance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractInkRequestBalance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_gas_limit.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_gas_limit.go new file mode 100644 index 00000000000..f5274360870 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_gas_limit.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the DeployContractInkRequestGasLimit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractInkRequestGasLimit{} + +// DeployContractInkRequestGasLimit struct for DeployContractInkRequestGasLimit +type DeployContractInkRequestGasLimit struct { + RefTime int32 `json:"refTime"` + ProofSize int32 `json:"proofSize"` +} + +// NewDeployContractInkRequestGasLimit instantiates a new DeployContractInkRequestGasLimit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractInkRequestGasLimit(refTime int32, proofSize int32) *DeployContractInkRequestGasLimit { + this := DeployContractInkRequestGasLimit{} + this.RefTime = refTime + this.ProofSize = proofSize + return &this +} + +// NewDeployContractInkRequestGasLimitWithDefaults instantiates a new DeployContractInkRequestGasLimit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractInkRequestGasLimitWithDefaults() *DeployContractInkRequestGasLimit { + this := DeployContractInkRequestGasLimit{} + return &this +} + +// GetRefTime returns the RefTime field value +func (o *DeployContractInkRequestGasLimit) GetRefTime() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RefTime +} + +// GetRefTimeOk returns a tuple with the RefTime field value +// and a boolean to check if the value has been set. +func (o *DeployContractInkRequestGasLimit) GetRefTimeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RefTime, true +} + +// SetRefTime sets field value +func (o *DeployContractInkRequestGasLimit) SetRefTime(v int32) { + o.RefTime = v +} + +// GetProofSize returns the ProofSize field value +func (o *DeployContractInkRequestGasLimit) GetProofSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ProofSize +} + +// GetProofSizeOk returns a tuple with the ProofSize field value +// and a boolean to check if the value has been set. +func (o *DeployContractInkRequestGasLimit) GetProofSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ProofSize, true +} + +// SetProofSize sets field value +func (o *DeployContractInkRequestGasLimit) SetProofSize(v int32) { + o.ProofSize = v +} + +func (o DeployContractInkRequestGasLimit) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractInkRequestGasLimit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["refTime"] = o.RefTime + toSerialize["proofSize"] = o.ProofSize + return toSerialize, nil +} + +type NullableDeployContractInkRequestGasLimit struct { + value *DeployContractInkRequestGasLimit + isSet bool +} + +func (v NullableDeployContractInkRequestGasLimit) Get() *DeployContractInkRequestGasLimit { + return v.value +} + +func (v *NullableDeployContractInkRequestGasLimit) Set(val *DeployContractInkRequestGasLimit) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractInkRequestGasLimit) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractInkRequestGasLimit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractInkRequestGasLimit(val *DeployContractInkRequestGasLimit) *NullableDeployContractInkRequestGasLimit { + return &NullableDeployContractInkRequestGasLimit{value: val, isSet: true} +} + +func (v NullableDeployContractInkRequestGasLimit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractInkRequestGasLimit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_salt.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_salt.go new file mode 100644 index 00000000000..07480e3e9d4 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_salt.go @@ -0,0 +1,123 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// DeployContractInkRequestSalt - struct for DeployContractInkRequestSalt +type DeployContractInkRequestSalt struct { + String *string +} + +// stringAsDeployContractInkRequestSalt is a convenience function that returns string wrapped in DeployContractInkRequestSalt +func StringAsDeployContractInkRequestSalt(v *string) DeployContractInkRequestSalt { + return DeployContractInkRequestSalt{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *DeployContractInkRequestSalt) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + 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(DeployContractInkRequestSalt)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(DeployContractInkRequestSalt)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src DeployContractInkRequestSalt) 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 *DeployContractInkRequestSalt) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableDeployContractInkRequestSalt struct { + value *DeployContractInkRequestSalt + isSet bool +} + +func (v NullableDeployContractInkRequestSalt) Get() *DeployContractInkRequestSalt { + return v.value +} + +func (v *NullableDeployContractInkRequestSalt) Set(val *DeployContractInkRequestSalt) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractInkRequestSalt) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractInkRequestSalt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractInkRequestSalt(val *DeployContractInkRequestSalt) *NullableDeployContractInkRequestSalt { + return &NullableDeployContractInkRequestSalt{value: val, isSet: true} +} + +func (v NullableDeployContractInkRequestSalt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractInkRequestSalt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_storage_deposit_limit.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_storage_deposit_limit.go new file mode 100644 index 00000000000..8851e45178d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_request_storage_deposit_limit.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// DeployContractInkRequestStorageDepositLimit - struct for DeployContractInkRequestStorageDepositLimit +type DeployContractInkRequestStorageDepositLimit struct { + Int32 *int32 + String *string +} + +// int32AsDeployContractInkRequestStorageDepositLimit is a convenience function that returns int32 wrapped in DeployContractInkRequestStorageDepositLimit +func Int32AsDeployContractInkRequestStorageDepositLimit(v *int32) DeployContractInkRequestStorageDepositLimit { + return DeployContractInkRequestStorageDepositLimit{ + Int32: v, + } +} + +// stringAsDeployContractInkRequestStorageDepositLimit is a convenience function that returns string wrapped in DeployContractInkRequestStorageDepositLimit +func StringAsDeployContractInkRequestStorageDepositLimit(v *string) DeployContractInkRequestStorageDepositLimit { + return DeployContractInkRequestStorageDepositLimit{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *DeployContractInkRequestStorageDepositLimit) UnmarshalJSON(data []byte) error { + var err error + // this object is nullable so check if the payload is null or empty string + if string(data) == "" || string(data) == "{}" { + return nil + } + + match := 0 + // try to unmarshal data into Int32 + err = newStrictDecoder(data).Decode(&dst.Int32) + if err == nil { + jsonInt32, _ := json.Marshal(dst.Int32) + if string(jsonInt32) == "{}" { // empty struct + dst.Int32 = nil + } else { + match++ + } + } else { + dst.Int32 = 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.Int32 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(DeployContractInkRequestStorageDepositLimit)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(DeployContractInkRequestStorageDepositLimit)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src DeployContractInkRequestStorageDepositLimit) MarshalJSON() ([]byte, error) { + if src.Int32 != nil { + return json.Marshal(&src.Int32) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *DeployContractInkRequestStorageDepositLimit) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Int32 != nil { + return obj.Int32 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableDeployContractInkRequestStorageDepositLimit struct { + value *DeployContractInkRequestStorageDepositLimit + isSet bool +} + +func (v NullableDeployContractInkRequestStorageDepositLimit) Get() *DeployContractInkRequestStorageDepositLimit { + return v.value +} + +func (v *NullableDeployContractInkRequestStorageDepositLimit) Set(val *DeployContractInkRequestStorageDepositLimit) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractInkRequestStorageDepositLimit) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractInkRequestStorageDepositLimit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractInkRequestStorageDepositLimit(val *DeployContractInkRequestStorageDepositLimit) *NullableDeployContractInkRequestStorageDepositLimit { + return &NullableDeployContractInkRequestStorageDepositLimit{value: val, isSet: true} +} + +func (v NullableDeployContractInkRequestStorageDepositLimit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractInkRequestStorageDepositLimit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_response.go new file mode 100644 index 00000000000..de23a05f284 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_deploy_contract_ink_response.go @@ -0,0 +1,153 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the DeployContractInkResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeployContractInkResponse{} + +// DeployContractInkResponse struct for DeployContractInkResponse +type DeployContractInkResponse struct { + Success bool `json:"success"` + ContractAddress *string `json:"contractAddress,omitempty"` +} + +// NewDeployContractInkResponse instantiates a new DeployContractInkResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeployContractInkResponse(success bool) *DeployContractInkResponse { + this := DeployContractInkResponse{} + this.Success = success + return &this +} + +// NewDeployContractInkResponseWithDefaults instantiates a new DeployContractInkResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeployContractInkResponseWithDefaults() *DeployContractInkResponse { + this := DeployContractInkResponse{} + return &this +} + +// GetSuccess returns the Success field value +func (o *DeployContractInkResponse) 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 *DeployContractInkResponse) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *DeployContractInkResponse) SetSuccess(v bool) { + o.Success = v +} + +// GetContractAddress returns the ContractAddress field value if set, zero value otherwise. +func (o *DeployContractInkResponse) 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 *DeployContractInkResponse) 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 *DeployContractInkResponse) 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 *DeployContractInkResponse) SetContractAddress(v string) { + o.ContractAddress = &v +} + +func (o DeployContractInkResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeployContractInkResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + if !IsNil(o.ContractAddress) { + toSerialize["contractAddress"] = o.ContractAddress + } + return toSerialize, nil +} + +type NullableDeployContractInkResponse struct { + value *DeployContractInkResponse + isSet bool +} + +func (v NullableDeployContractInkResponse) Get() *DeployContractInkResponse { + return v.value +} + +func (v *NullableDeployContractInkResponse) Set(val *DeployContractInkResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeployContractInkResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeployContractInkResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeployContractInkResponse(val *DeployContractInkResponse) *NullableDeployContractInkResponse { + return &NullableDeployContractInkResponse{value: val, isSet: true} +} + +func (v NullableDeployContractInkResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeployContractInkResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_error_exception_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_error_exception_response.go new file mode 100644 index 00000000000..b2123f98de7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_error_exception_response.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the ErrorExceptionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorExceptionResponse{} + +// ErrorExceptionResponse Error response from the connector. +type ErrorExceptionResponse struct { + // Short error description message. + Message string `json:"message"` + // Detailed error information. + Error string `json:"error"` +} + +// NewErrorExceptionResponse instantiates a new ErrorExceptionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorExceptionResponse(message string, error_ string) *ErrorExceptionResponse { + this := ErrorExceptionResponse{} + this.Message = message + this.Error = error_ + return &this +} + +// NewErrorExceptionResponseWithDefaults instantiates a new ErrorExceptionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorExceptionResponseWithDefaults() *ErrorExceptionResponse { + this := ErrorExceptionResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorExceptionResponse) 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 *ErrorExceptionResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ErrorExceptionResponse) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +func (o *ErrorExceptionResponse) 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 *ErrorExceptionResponse) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *ErrorExceptionResponse) SetError(v string) { + o.Error = v +} + +func (o ErrorExceptionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorExceptionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error + return toSerialize, nil +} + +type NullableErrorExceptionResponse struct { + value *ErrorExceptionResponse + isSet bool +} + +func (v NullableErrorExceptionResponse) Get() *ErrorExceptionResponse { + return v.value +} + +func (v *NullableErrorExceptionResponse) Set(val *ErrorExceptionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorExceptionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorExceptionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorExceptionResponse(val *ErrorExceptionResponse) *NullableErrorExceptionResponse { + return &NullableErrorExceptionResponse{value: val, isSet: true} +} + +func (v NullableErrorExceptionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorExceptionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_request.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_request.go new file mode 100644 index 00000000000..527ecced4ea --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_request.go @@ -0,0 +1,399 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the InvokeContractRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractRequest{} + +// InvokeContractRequest struct for InvokeContractRequest +type InvokeContractRequest struct { + InvocationType PolkadotContractInvocationType `json:"invocationType"` + AccountAddress string `json:"accountAddress"` + Web3SigningCredential Web3SigningCredential `json:"web3SigningCredential"` + Metadata PolkadotTransactionConfigTransferSubmittable `json:"metadata"` + ContractAddress string `json:"contractAddress"` + // The name of the contract method to invoke. + MethodName string `json:"methodName"` + GasLimit DeployContractInkRequestGasLimit `json:"gasLimit"` + StorageDepositLimit NullableDeployContractInkRequestStorageDepositLimit `json:"storageDepositLimit,omitempty"` + Balance *DeployContractInkRequestBalance `json:"balance,omitempty"` + // The list of arguments to pass in to the contract method being invoked + Params []interface{} `json:"params,omitempty"` +} + +// NewInvokeContractRequest instantiates a new InvokeContractRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractRequest(invocationType PolkadotContractInvocationType, accountAddress string, web3SigningCredential Web3SigningCredential, metadata PolkadotTransactionConfigTransferSubmittable, contractAddress string, methodName string, gasLimit DeployContractInkRequestGasLimit) *InvokeContractRequest { + this := InvokeContractRequest{} + this.InvocationType = invocationType + this.AccountAddress = accountAddress + this.Web3SigningCredential = web3SigningCredential + this.Metadata = metadata + this.ContractAddress = contractAddress + this.MethodName = methodName + this.GasLimit = gasLimit + return &this +} + +// NewInvokeContractRequestWithDefaults instantiates a new InvokeContractRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractRequestWithDefaults() *InvokeContractRequest { + this := InvokeContractRequest{} + return &this +} + +// GetInvocationType returns the InvocationType field value +func (o *InvokeContractRequest) GetInvocationType() PolkadotContractInvocationType { + if o == nil { + var ret PolkadotContractInvocationType + 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 *InvokeContractRequest) GetInvocationTypeOk() (*PolkadotContractInvocationType, bool) { + if o == nil { + return nil, false + } + return &o.InvocationType, true +} + +// SetInvocationType sets field value +func (o *InvokeContractRequest) SetInvocationType(v PolkadotContractInvocationType) { + o.InvocationType = v +} + +// GetAccountAddress returns the AccountAddress field value +func (o *InvokeContractRequest) GetAccountAddress() string { + if o == nil { + var ret string + return ret + } + + return o.AccountAddress +} + +// GetAccountAddressOk returns a tuple with the AccountAddress field value +// and a boolean to check if the value has been set. +func (o *InvokeContractRequest) GetAccountAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountAddress, true +} + +// SetAccountAddress sets field value +func (o *InvokeContractRequest) SetAccountAddress(v string) { + o.AccountAddress = v +} + +// GetWeb3SigningCredential returns the Web3SigningCredential field value +func (o *InvokeContractRequest) 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 *InvokeContractRequest) GetWeb3SigningCredentialOk() (*Web3SigningCredential, bool) { + if o == nil { + return nil, false + } + return &o.Web3SigningCredential, true +} + +// SetWeb3SigningCredential sets field value +func (o *InvokeContractRequest) SetWeb3SigningCredential(v Web3SigningCredential) { + o.Web3SigningCredential = v +} + +// GetMetadata returns the Metadata field value +func (o *InvokeContractRequest) GetMetadata() PolkadotTransactionConfigTransferSubmittable { + if o == nil { + var ret PolkadotTransactionConfigTransferSubmittable + return ret + } + + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +func (o *InvokeContractRequest) GetMetadataOk() (*PolkadotTransactionConfigTransferSubmittable, bool) { + if o == nil { + return nil, false + } + return &o.Metadata, true +} + +// SetMetadata sets field value +func (o *InvokeContractRequest) SetMetadata(v PolkadotTransactionConfigTransferSubmittable) { + o.Metadata = v +} + +// GetContractAddress returns the ContractAddress field value +func (o *InvokeContractRequest) 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 *InvokeContractRequest) GetContractAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ContractAddress, true +} + +// SetContractAddress sets field value +func (o *InvokeContractRequest) SetContractAddress(v string) { + o.ContractAddress = v +} + +// GetMethodName returns the MethodName field value +func (o *InvokeContractRequest) 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 *InvokeContractRequest) GetMethodNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MethodName, true +} + +// SetMethodName sets field value +func (o *InvokeContractRequest) SetMethodName(v string) { + o.MethodName = v +} + +// GetGasLimit returns the GasLimit field value +func (o *InvokeContractRequest) GetGasLimit() DeployContractInkRequestGasLimit { + if o == nil { + var ret DeployContractInkRequestGasLimit + 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 *InvokeContractRequest) GetGasLimitOk() (*DeployContractInkRequestGasLimit, bool) { + if o == nil { + return nil, false + } + return &o.GasLimit, true +} + +// SetGasLimit sets field value +func (o *InvokeContractRequest) SetGasLimit(v DeployContractInkRequestGasLimit) { + o.GasLimit = v +} + +// GetStorageDepositLimit returns the StorageDepositLimit field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractRequest) GetStorageDepositLimit() DeployContractInkRequestStorageDepositLimit { + if o == nil || IsNil(o.StorageDepositLimit.Get()) { + var ret DeployContractInkRequestStorageDepositLimit + return ret + } + return *o.StorageDepositLimit.Get() +} + +// GetStorageDepositLimitOk returns a tuple with the StorageDepositLimit 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 *InvokeContractRequest) GetStorageDepositLimitOk() (*DeployContractInkRequestStorageDepositLimit, bool) { + if o == nil { + return nil, false + } + return o.StorageDepositLimit.Get(), o.StorageDepositLimit.IsSet() +} + +// HasStorageDepositLimit returns a boolean if a field has been set. +func (o *InvokeContractRequest) HasStorageDepositLimit() bool { + if o != nil && o.StorageDepositLimit.IsSet() { + return true + } + + return false +} + +// SetStorageDepositLimit gets a reference to the given NullableDeployContractInkRequestStorageDepositLimit and assigns it to the StorageDepositLimit field. +func (o *InvokeContractRequest) SetStorageDepositLimit(v DeployContractInkRequestStorageDepositLimit) { + o.StorageDepositLimit.Set(&v) +} +// SetStorageDepositLimitNil sets the value for StorageDepositLimit to be an explicit nil +func (o *InvokeContractRequest) SetStorageDepositLimitNil() { + o.StorageDepositLimit.Set(nil) +} + +// UnsetStorageDepositLimit ensures that no value is present for StorageDepositLimit, not even an explicit nil +func (o *InvokeContractRequest) UnsetStorageDepositLimit() { + o.StorageDepositLimit.Unset() +} + +// GetBalance returns the Balance field value if set, zero value otherwise. +func (o *InvokeContractRequest) GetBalance() DeployContractInkRequestBalance { + if o == nil || IsNil(o.Balance) { + var ret DeployContractInkRequestBalance + 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 *InvokeContractRequest) GetBalanceOk() (*DeployContractInkRequestBalance, 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 *InvokeContractRequest) HasBalance() bool { + if o != nil && !IsNil(o.Balance) { + return true + } + + return false +} + +// SetBalance gets a reference to the given DeployContractInkRequestBalance and assigns it to the Balance field. +func (o *InvokeContractRequest) SetBalance(v DeployContractInkRequestBalance) { + o.Balance = &v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *InvokeContractRequest) 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 *InvokeContractRequest) 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 *InvokeContractRequest) 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 *InvokeContractRequest) SetParams(v []interface{}) { + o.Params = v +} + +func (o InvokeContractRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["invocationType"] = o.InvocationType + toSerialize["accountAddress"] = o.AccountAddress + toSerialize["web3SigningCredential"] = o.Web3SigningCredential + toSerialize["metadata"] = o.Metadata + toSerialize["contractAddress"] = o.ContractAddress + toSerialize["methodName"] = o.MethodName + toSerialize["gasLimit"] = o.GasLimit + if o.StorageDepositLimit.IsSet() { + toSerialize["storageDepositLimit"] = o.StorageDepositLimit.Get() + } + if !IsNil(o.Balance) { + toSerialize["balance"] = o.Balance + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + return toSerialize, nil +} + +type NullableInvokeContractRequest struct { + value *InvokeContractRequest + isSet bool +} + +func (v NullableInvokeContractRequest) Get() *InvokeContractRequest { + return v.value +} + +func (v *NullableInvokeContractRequest) Set(val *InvokeContractRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractRequest(val *InvokeContractRequest) *NullableInvokeContractRequest { + return &NullableInvokeContractRequest{value: val, isSet: true} +} + +func (v NullableInvokeContractRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_response.go new file mode 100644 index 00000000000..bbce56d4a47 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_invoke_contract_response.go @@ -0,0 +1,226 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the InvokeContractResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvokeContractResponse{} + +// InvokeContractResponse struct for InvokeContractResponse +type InvokeContractResponse struct { + CallOutput interface{} `json:"callOutput,omitempty"` + Success bool `json:"success"` + TxHash *string `json:"txHash,omitempty"` + BlockHash *string `json:"blockHash,omitempty"` +} + +// NewInvokeContractResponse instantiates a new InvokeContractResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvokeContractResponse(success bool) *InvokeContractResponse { + this := InvokeContractResponse{} + this.Success = success + return &this +} + +// NewInvokeContractResponseWithDefaults instantiates a new InvokeContractResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvokeContractResponseWithDefaults() *InvokeContractResponse { + this := InvokeContractResponse{} + return &this +} + +// GetCallOutput returns the CallOutput field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvokeContractResponse) 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 *InvokeContractResponse) 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 *InvokeContractResponse) 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 *InvokeContractResponse) SetCallOutput(v interface{}) { + o.CallOutput = v +} + +// GetSuccess returns the Success field value +func (o *InvokeContractResponse) 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 *InvokeContractResponse) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *InvokeContractResponse) SetSuccess(v bool) { + o.Success = v +} + +// GetTxHash returns the TxHash field value if set, zero value otherwise. +func (o *InvokeContractResponse) GetTxHash() string { + if o == nil || IsNil(o.TxHash) { + var ret string + return ret + } + return *o.TxHash +} + +// GetTxHashOk returns a tuple with the TxHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvokeContractResponse) GetTxHashOk() (*string, bool) { + if o == nil || IsNil(o.TxHash) { + return nil, false + } + return o.TxHash, true +} + +// HasTxHash returns a boolean if a field has been set. +func (o *InvokeContractResponse) HasTxHash() bool { + if o != nil && !IsNil(o.TxHash) { + return true + } + + return false +} + +// SetTxHash gets a reference to the given string and assigns it to the TxHash field. +func (o *InvokeContractResponse) SetTxHash(v string) { + o.TxHash = &v +} + +// GetBlockHash returns the BlockHash field value if set, zero value otherwise. +func (o *InvokeContractResponse) GetBlockHash() string { + if o == nil || IsNil(o.BlockHash) { + var ret string + 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 *InvokeContractResponse) GetBlockHashOk() (*string, 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 *InvokeContractResponse) HasBlockHash() bool { + if o != nil && !IsNil(o.BlockHash) { + return true + } + + return false +} + +// SetBlockHash gets a reference to the given string and assigns it to the BlockHash field. +func (o *InvokeContractResponse) SetBlockHash(v string) { + o.BlockHash = &v +} + +func (o InvokeContractResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvokeContractResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.CallOutput != nil { + toSerialize["callOutput"] = o.CallOutput + } + toSerialize["success"] = o.Success + if !IsNil(o.TxHash) { + toSerialize["txHash"] = o.TxHash + } + if !IsNil(o.BlockHash) { + toSerialize["blockHash"] = o.BlockHash + } + return toSerialize, nil +} + +type NullableInvokeContractResponse struct { + value *InvokeContractResponse + isSet bool +} + +func (v NullableInvokeContractResponse) Get() *InvokeContractResponse { + return v.value +} + +func (v *NullableInvokeContractResponse) Set(val *InvokeContractResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInvokeContractResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInvokeContractResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvokeContractResponse(val *InvokeContractResponse) *NullableInvokeContractResponse { + return &NullableInvokeContractResponse{value: val, isSet: true} +} + +func (v NullableInvokeContractResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvokeContractResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_contract_invocation_type.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_contract_invocation_type.go new file mode 100644 index 00000000000..fb10ffeaa09 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_contract_invocation_type.go @@ -0,0 +1,111 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// PolkadotContractInvocationType the model 'PolkadotContractInvocationType' +type PolkadotContractInvocationType string + +// List of PolkadotContractInvocationType +const ( + SEND PolkadotContractInvocationType = "SEND" + QUERY PolkadotContractInvocationType = "QUERY" +) + +// All allowed values of PolkadotContractInvocationType enum +var AllowedPolkadotContractInvocationTypeEnumValues = []PolkadotContractInvocationType{ + "SEND", + "QUERY", +} + +func (v *PolkadotContractInvocationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PolkadotContractInvocationType(value) + for _, existing := range AllowedPolkadotContractInvocationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PolkadotContractInvocationType", value) +} + +// NewPolkadotContractInvocationTypeFromValue returns a pointer to a valid PolkadotContractInvocationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPolkadotContractInvocationTypeFromValue(v string) (*PolkadotContractInvocationType, error) { + ev := PolkadotContractInvocationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PolkadotContractInvocationType: valid values are %v", v, AllowedPolkadotContractInvocationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PolkadotContractInvocationType) IsValid() bool { + for _, existing := range AllowedPolkadotContractInvocationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PolkadotContractInvocationType value +func (v PolkadotContractInvocationType) Ptr() *PolkadotContractInvocationType { + return &v +} + +type NullablePolkadotContractInvocationType struct { + value *PolkadotContractInvocationType + isSet bool +} + +func (v NullablePolkadotContractInvocationType) Get() *PolkadotContractInvocationType { + return v.value +} + +func (v *NullablePolkadotContractInvocationType) Set(val *PolkadotContractInvocationType) { + v.value = val + v.isSet = true +} + +func (v NullablePolkadotContractInvocationType) IsSet() bool { + return v.isSet +} + +func (v *NullablePolkadotContractInvocationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolkadotContractInvocationType(val *PolkadotContractInvocationType) *NullablePolkadotContractInvocationType { + return &NullablePolkadotContractInvocationType{value: val, isSet: true} +} + +func (v NullablePolkadotContractInvocationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolkadotContractInvocationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config.go new file mode 100644 index 00000000000..5548aa76e58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config.go @@ -0,0 +1,225 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the PolkadotTransactionConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PolkadotTransactionConfig{} + +// PolkadotTransactionConfig struct for PolkadotTransactionConfig +type PolkadotTransactionConfig struct { + TransferSubmittable *PolkadotTransactionConfigTransferSubmittable `json:"transferSubmittable,omitempty"` + To *PolkadotTransactionConfigTransferSubmittable `json:"to,omitempty"` + Value *PolkadotTransactionConfigValue `json:"value,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PolkadotTransactionConfig PolkadotTransactionConfig + +// NewPolkadotTransactionConfig instantiates a new PolkadotTransactionConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPolkadotTransactionConfig() *PolkadotTransactionConfig { + this := PolkadotTransactionConfig{} + return &this +} + +// NewPolkadotTransactionConfigWithDefaults instantiates a new PolkadotTransactionConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPolkadotTransactionConfigWithDefaults() *PolkadotTransactionConfig { + this := PolkadotTransactionConfig{} + return &this +} + +// GetTransferSubmittable returns the TransferSubmittable field value if set, zero value otherwise. +func (o *PolkadotTransactionConfig) GetTransferSubmittable() PolkadotTransactionConfigTransferSubmittable { + if o == nil || IsNil(o.TransferSubmittable) { + var ret PolkadotTransactionConfigTransferSubmittable + return ret + } + return *o.TransferSubmittable +} + +// GetTransferSubmittableOk returns a tuple with the TransferSubmittable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolkadotTransactionConfig) GetTransferSubmittableOk() (*PolkadotTransactionConfigTransferSubmittable, bool) { + if o == nil || IsNil(o.TransferSubmittable) { + return nil, false + } + return o.TransferSubmittable, true +} + +// HasTransferSubmittable returns a boolean if a field has been set. +func (o *PolkadotTransactionConfig) HasTransferSubmittable() bool { + if o != nil && !IsNil(o.TransferSubmittable) { + return true + } + + return false +} + +// SetTransferSubmittable gets a reference to the given PolkadotTransactionConfigTransferSubmittable and assigns it to the TransferSubmittable field. +func (o *PolkadotTransactionConfig) SetTransferSubmittable(v PolkadotTransactionConfigTransferSubmittable) { + o.TransferSubmittable = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *PolkadotTransactionConfig) GetTo() PolkadotTransactionConfigTransferSubmittable { + if o == nil || IsNil(o.To) { + var ret PolkadotTransactionConfigTransferSubmittable + 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 *PolkadotTransactionConfig) GetToOk() (*PolkadotTransactionConfigTransferSubmittable, 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 *PolkadotTransactionConfig) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given PolkadotTransactionConfigTransferSubmittable and assigns it to the To field. +func (o *PolkadotTransactionConfig) SetTo(v PolkadotTransactionConfigTransferSubmittable) { + o.To = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PolkadotTransactionConfig) GetValue() PolkadotTransactionConfigValue { + if o == nil || IsNil(o.Value) { + var ret PolkadotTransactionConfigValue + 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 *PolkadotTransactionConfig) GetValueOk() (*PolkadotTransactionConfigValue, 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 *PolkadotTransactionConfig) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given PolkadotTransactionConfigValue and assigns it to the Value field. +func (o *PolkadotTransactionConfig) SetValue(v PolkadotTransactionConfigValue) { + o.Value = &v +} + +func (o PolkadotTransactionConfig) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PolkadotTransactionConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TransferSubmittable) { + toSerialize["transferSubmittable"] = o.TransferSubmittable + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PolkadotTransactionConfig) UnmarshalJSON(bytes []byte) (err error) { + varPolkadotTransactionConfig := _PolkadotTransactionConfig{} + + if err = json.Unmarshal(bytes, &varPolkadotTransactionConfig); err == nil { + *o = PolkadotTransactionConfig(varPolkadotTransactionConfig) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "transferSubmittable") + delete(additionalProperties, "to") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePolkadotTransactionConfig struct { + value *PolkadotTransactionConfig + isSet bool +} + +func (v NullablePolkadotTransactionConfig) Get() *PolkadotTransactionConfig { + return v.value +} + +func (v *NullablePolkadotTransactionConfig) Set(val *PolkadotTransactionConfig) { + v.value = val + v.isSet = true +} + +func (v NullablePolkadotTransactionConfig) IsSet() bool { + return v.isSet +} + +func (v *NullablePolkadotTransactionConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolkadotTransactionConfig(val *PolkadotTransactionConfig) *NullablePolkadotTransactionConfig { + return &NullablePolkadotTransactionConfig{value: val, isSet: true} +} + +func (v NullablePolkadotTransactionConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolkadotTransactionConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_transfer_submittable.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_transfer_submittable.go new file mode 100644 index 00000000000..6d36e053bb5 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_transfer_submittable.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// PolkadotTransactionConfigTransferSubmittable - struct for PolkadotTransactionConfigTransferSubmittable +type PolkadotTransactionConfigTransferSubmittable struct { + String *string +} + +// stringAsPolkadotTransactionConfigTransferSubmittable is a convenience function that returns string wrapped in PolkadotTransactionConfigTransferSubmittable +func StringAsPolkadotTransactionConfigTransferSubmittable(v *string) PolkadotTransactionConfigTransferSubmittable { + return PolkadotTransactionConfigTransferSubmittable{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PolkadotTransactionConfigTransferSubmittable) 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(PolkadotTransactionConfigTransferSubmittable)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(PolkadotTransactionConfigTransferSubmittable)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PolkadotTransactionConfigTransferSubmittable) 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 *PolkadotTransactionConfigTransferSubmittable) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullablePolkadotTransactionConfigTransferSubmittable struct { + value *PolkadotTransactionConfigTransferSubmittable + isSet bool +} + +func (v NullablePolkadotTransactionConfigTransferSubmittable) Get() *PolkadotTransactionConfigTransferSubmittable { + return v.value +} + +func (v *NullablePolkadotTransactionConfigTransferSubmittable) Set(val *PolkadotTransactionConfigTransferSubmittable) { + v.value = val + v.isSet = true +} + +func (v NullablePolkadotTransactionConfigTransferSubmittable) IsSet() bool { + return v.isSet +} + +func (v *NullablePolkadotTransactionConfigTransferSubmittable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolkadotTransactionConfigTransferSubmittable(val *PolkadotTransactionConfigTransferSubmittable) *NullablePolkadotTransactionConfigTransferSubmittable { + return &NullablePolkadotTransactionConfigTransferSubmittable{value: val, isSet: true} +} + +func (v NullablePolkadotTransactionConfigTransferSubmittable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolkadotTransactionConfigTransferSubmittable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_value.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_value.go new file mode 100644 index 00000000000..aeea25fb191 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_polkadot_transaction_config_value.go @@ -0,0 +1,118 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// PolkadotTransactionConfigValue - struct for PolkadotTransactionConfigValue +type PolkadotTransactionConfigValue struct { + Float32 *float32 +} + +// float32AsPolkadotTransactionConfigValue is a convenience function that returns float32 wrapped in PolkadotTransactionConfigValue +func Float32AsPolkadotTransactionConfigValue(v *float32) PolkadotTransactionConfigValue { + return PolkadotTransactionConfigValue{ + Float32: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PolkadotTransactionConfigValue) 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 + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Float32 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(PolkadotTransactionConfigValue)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(PolkadotTransactionConfigValue)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PolkadotTransactionConfigValue) MarshalJSON() ([]byte, error) { + if src.Float32 != nil { + return json.Marshal(&src.Float32) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PolkadotTransactionConfigValue) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.Float32 != nil { + return obj.Float32 + } + + // all schemas are nil + return nil +} + +type NullablePolkadotTransactionConfigValue struct { + value *PolkadotTransactionConfigValue + isSet bool +} + +func (v NullablePolkadotTransactionConfigValue) Get() *PolkadotTransactionConfigValue { + return v.value +} + +func (v *NullablePolkadotTransactionConfigValue) Set(val *PolkadotTransactionConfigValue) { + v.value = val + v.isSet = true +} + +func (v NullablePolkadotTransactionConfigValue) IsSet() bool { + return v.isSet +} + +func (v *NullablePolkadotTransactionConfigValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolkadotTransactionConfigValue(val *PolkadotTransactionConfigValue) *NullablePolkadotTransactionConfigValue { + return &NullablePolkadotTransactionConfigValue{value: val, isSet: true} +} + +func (v NullablePolkadotTransactionConfigValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolkadotTransactionConfigValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_request.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_request.go new file mode 100644 index 00000000000..fb28c32606d --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_request.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the RawTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawTransactionRequest{} + +// RawTransactionRequest struct for RawTransactionRequest +type RawTransactionRequest struct { + To string `json:"to"` + Value float32 `json:"value"` +} + +// NewRawTransactionRequest instantiates a new RawTransactionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawTransactionRequest(to string, value float32) *RawTransactionRequest { + this := RawTransactionRequest{} + this.To = to + this.Value = value + return &this +} + +// NewRawTransactionRequestWithDefaults instantiates a new RawTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawTransactionRequestWithDefaults() *RawTransactionRequest { + this := RawTransactionRequest{} + return &this +} + +// GetTo returns the To field value +func (o *RawTransactionRequest) 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 *RawTransactionRequest) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *RawTransactionRequest) SetTo(v string) { + o.To = v +} + +// GetValue returns the Value field value +func (o *RawTransactionRequest) GetValue() float32 { + if o == nil { + var ret float32 + 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 *RawTransactionRequest) GetValueOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *RawTransactionRequest) SetValue(v float32) { + o.Value = v +} + +func (o RawTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["to"] = o.To + toSerialize["value"] = o.Value + return toSerialize, nil +} + +type NullableRawTransactionRequest struct { + value *RawTransactionRequest + isSet bool +} + +func (v NullableRawTransactionRequest) Get() *RawTransactionRequest { + return v.value +} + +func (v *NullableRawTransactionRequest) Set(val *RawTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRawTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRawTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawTransactionRequest(val *RawTransactionRequest) *NullableRawTransactionRequest { + return &NullableRawTransactionRequest{value: val, isSet: true} +} + +func (v NullableRawTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response.go new file mode 100644 index 00000000000..e0efdc3df15 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the RawTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawTransactionResponse{} + +// RawTransactionResponse struct for RawTransactionResponse +type RawTransactionResponse struct { + ResponseContainer RawTransactionResponseResponseContainer `json:"responseContainer"` +} + +// NewRawTransactionResponse instantiates a new RawTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawTransactionResponse(responseContainer RawTransactionResponseResponseContainer) *RawTransactionResponse { + this := RawTransactionResponse{} + this.ResponseContainer = responseContainer + return &this +} + +// NewRawTransactionResponseWithDefaults instantiates a new RawTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawTransactionResponseWithDefaults() *RawTransactionResponse { + this := RawTransactionResponse{} + return &this +} + +// GetResponseContainer returns the ResponseContainer field value +func (o *RawTransactionResponse) GetResponseContainer() RawTransactionResponseResponseContainer { + if o == nil { + var ret RawTransactionResponseResponseContainer + return ret + } + + return o.ResponseContainer +} + +// GetResponseContainerOk returns a tuple with the ResponseContainer field value +// and a boolean to check if the value has been set. +func (o *RawTransactionResponse) GetResponseContainerOk() (*RawTransactionResponseResponseContainer, bool) { + if o == nil { + return nil, false + } + return &o.ResponseContainer, true +} + +// SetResponseContainer sets field value +func (o *RawTransactionResponse) SetResponseContainer(v RawTransactionResponseResponseContainer) { + o.ResponseContainer = v +} + +func (o RawTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["responseContainer"] = o.ResponseContainer + return toSerialize, nil +} + +type NullableRawTransactionResponse struct { + value *RawTransactionResponse + isSet bool +} + +func (v NullableRawTransactionResponse) Get() *RawTransactionResponse { + return v.value +} + +func (v *NullableRawTransactionResponse) Set(val *RawTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRawTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRawTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawTransactionResponse(val *RawTransactionResponse) *NullableRawTransactionResponse { + return &NullableRawTransactionResponse{value: val, isSet: true} +} + +func (v NullableRawTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_data.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_data.go new file mode 100644 index 00000000000..6faf5b0e4bc --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_data.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the RawTransactionResponseData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawTransactionResponseData{} + +// RawTransactionResponseData struct for RawTransactionResponseData +type RawTransactionResponseData struct { + RawTransaction string `json:"rawTransaction"` +} + +// NewRawTransactionResponseData instantiates a new RawTransactionResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawTransactionResponseData(rawTransaction string) *RawTransactionResponseData { + this := RawTransactionResponseData{} + this.RawTransaction = rawTransaction + return &this +} + +// NewRawTransactionResponseDataWithDefaults instantiates a new RawTransactionResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawTransactionResponseDataWithDefaults() *RawTransactionResponseData { + this := RawTransactionResponseData{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value +func (o *RawTransactionResponseData) GetRawTransaction() string { + if o == nil { + var ret string + return ret + } + + return o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value +// and a boolean to check if the value has been set. +func (o *RawTransactionResponseData) GetRawTransactionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RawTransaction, true +} + +// SetRawTransaction sets field value +func (o *RawTransactionResponseData) SetRawTransaction(v string) { + o.RawTransaction = v +} + +func (o RawTransactionResponseData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawTransactionResponseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["rawTransaction"] = o.RawTransaction + return toSerialize, nil +} + +type NullableRawTransactionResponseData struct { + value *RawTransactionResponseData + isSet bool +} + +func (v NullableRawTransactionResponseData) Get() *RawTransactionResponseData { + return v.value +} + +func (v *NullableRawTransactionResponseData) Set(val *RawTransactionResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableRawTransactionResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableRawTransactionResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawTransactionResponseData(val *RawTransactionResponseData) *NullableRawTransactionResponseData { + return &NullableRawTransactionResponseData{value: val, isSet: true} +} + +func (v NullableRawTransactionResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawTransactionResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_response_container.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_response_container.go new file mode 100644 index 00000000000..1ded9ded9b1 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_raw_transaction_response_response_container.go @@ -0,0 +1,200 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the RawTransactionResponseResponseContainer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RawTransactionResponseResponseContainer{} + +// RawTransactionResponseResponseContainer struct for RawTransactionResponseResponseContainer +type RawTransactionResponseResponseContainer struct { + ResponseData RawTransactionResponseData `json:"response_data"` + Succeeded bool `json:"succeeded"` + Message string `json:"message"` + Error NullableString `json:"error"` +} + +// NewRawTransactionResponseResponseContainer instantiates a new RawTransactionResponseResponseContainer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRawTransactionResponseResponseContainer(responseData RawTransactionResponseData, succeeded bool, message string, error_ NullableString) *RawTransactionResponseResponseContainer { + this := RawTransactionResponseResponseContainer{} + this.ResponseData = responseData + this.Succeeded = succeeded + this.Message = message + this.Error = error_ + return &this +} + +// NewRawTransactionResponseResponseContainerWithDefaults instantiates a new RawTransactionResponseResponseContainer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRawTransactionResponseResponseContainerWithDefaults() *RawTransactionResponseResponseContainer { + this := RawTransactionResponseResponseContainer{} + return &this +} + +// GetResponseData returns the ResponseData field value +func (o *RawTransactionResponseResponseContainer) GetResponseData() RawTransactionResponseData { + if o == nil { + var ret RawTransactionResponseData + return ret + } + + return o.ResponseData +} + +// GetResponseDataOk returns a tuple with the ResponseData field value +// and a boolean to check if the value has been set. +func (o *RawTransactionResponseResponseContainer) GetResponseDataOk() (*RawTransactionResponseData, bool) { + if o == nil { + return nil, false + } + return &o.ResponseData, true +} + +// SetResponseData sets field value +func (o *RawTransactionResponseResponseContainer) SetResponseData(v RawTransactionResponseData) { + o.ResponseData = v +} + +// GetSucceeded returns the Succeeded field value +func (o *RawTransactionResponseResponseContainer) GetSucceeded() bool { + if o == nil { + var ret bool + return ret + } + + return o.Succeeded +} + +// GetSucceededOk returns a tuple with the Succeeded field value +// and a boolean to check if the value has been set. +func (o *RawTransactionResponseResponseContainer) GetSucceededOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Succeeded, true +} + +// SetSucceeded sets field value +func (o *RawTransactionResponseResponseContainer) SetSucceeded(v bool) { + o.Succeeded = v +} + +// GetMessage returns the Message field value +func (o *RawTransactionResponseResponseContainer) 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 *RawTransactionResponseResponseContainer) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *RawTransactionResponseResponseContainer) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RawTransactionResponseResponseContainer) GetError() string { + if o == nil || o.Error.Get() == nil { + var ret string + return ret + } + + return *o.Error.Get() +} + +// GetErrorOk returns a tuple with the Error 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 *RawTransactionResponseResponseContainer) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Error.Get(), o.Error.IsSet() +} + +// SetError sets field value +func (o *RawTransactionResponseResponseContainer) SetError(v string) { + o.Error.Set(&v) +} + +func (o RawTransactionResponseResponseContainer) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RawTransactionResponseResponseContainer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["response_data"] = o.ResponseData + toSerialize["succeeded"] = o.Succeeded + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error.Get() + return toSerialize, nil +} + +type NullableRawTransactionResponseResponseContainer struct { + value *RawTransactionResponseResponseContainer + isSet bool +} + +func (v NullableRawTransactionResponseResponseContainer) Get() *RawTransactionResponseResponseContainer { + return v.value +} + +func (v *NullableRawTransactionResponseResponseContainer) Set(val *RawTransactionResponseResponseContainer) { + v.value = val + v.isSet = true +} + +func (v NullableRawTransactionResponseResponseContainer) IsSet() bool { + return v.isSet +} + +func (v *NullableRawTransactionResponseResponseContainer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRawTransactionResponseResponseContainer(val *RawTransactionResponseResponseContainer) *NullableRawTransactionResponseResponseContainer { + return &NullableRawTransactionResponseResponseContainer{value: val, isSet: true} +} + +func (v NullableRawTransactionResponseResponseContainer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRawTransactionResponseResponseContainer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_request.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_request.go new file mode 100644 index 00000000000..345a53b6e4b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_request.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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 PolkadotTransactionConfig `json:"transactionConfig"` +} + +// 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 PolkadotTransactionConfig) *RunTransactionRequest { + this := RunTransactionRequest{} + this.Web3SigningCredential = web3SigningCredential + this.TransactionConfig = transactionConfig + 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() PolkadotTransactionConfig { + if o == nil { + var ret PolkadotTransactionConfig + 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() (*PolkadotTransactionConfig, bool) { + if o == nil { + return nil, false + } + return &o.TransactionConfig, true +} + +// SetTransactionConfig sets field value +func (o *RunTransactionRequest) SetTransactionConfig(v PolkadotTransactionConfig) { + o.TransactionConfig = 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 + 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-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_response.go new file mode 100644 index 00000000000..8a17d872335 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_run_transaction_response.go @@ -0,0 +1,189 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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 { + Success bool `json:"success"` + TxHash *string `json:"txHash,omitempty"` + BlockHash *string `json:"blockHash,omitempty"` +} + +// 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(success bool) *RunTransactionResponse { + this := RunTransactionResponse{} + this.Success = success + 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 +} + +// GetSuccess returns the Success field value +func (o *RunTransactionResponse) 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 *RunTransactionResponse) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *RunTransactionResponse) SetSuccess(v bool) { + o.Success = v +} + +// GetTxHash returns the TxHash field value if set, zero value otherwise. +func (o *RunTransactionResponse) GetTxHash() string { + if o == nil || IsNil(o.TxHash) { + var ret string + return ret + } + return *o.TxHash +} + +// GetTxHashOk returns a tuple with the TxHash field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RunTransactionResponse) GetTxHashOk() (*string, bool) { + if o == nil || IsNil(o.TxHash) { + return nil, false + } + return o.TxHash, true +} + +// HasTxHash returns a boolean if a field has been set. +func (o *RunTransactionResponse) HasTxHash() bool { + if o != nil && !IsNil(o.TxHash) { + return true + } + + return false +} + +// SetTxHash gets a reference to the given string and assigns it to the TxHash field. +func (o *RunTransactionResponse) SetTxHash(v string) { + o.TxHash = &v +} + +// GetBlockHash returns the BlockHash field value if set, zero value otherwise. +func (o *RunTransactionResponse) GetBlockHash() string { + if o == nil || IsNil(o.BlockHash) { + var ret string + 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 *RunTransactionResponse) GetBlockHashOk() (*string, 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 *RunTransactionResponse) HasBlockHash() bool { + if o != nil && !IsNil(o.BlockHash) { + return true + } + + return false +} + +// SetBlockHash gets a reference to the given string and assigns it to the BlockHash field. +func (o *RunTransactionResponse) SetBlockHash(v string) { + o.BlockHash = &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["success"] = o.Success + if !IsNil(o.TxHash) { + toSerialize["txHash"] = o.TxHash + } + if !IsNil(o.BlockHash) { + toSerialize["blockHash"] = o.BlockHash + } + 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-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_request.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_request.go new file mode 100644 index 00000000000..31e5f10f535 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_request.go @@ -0,0 +1,180 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the SignRawTransactionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SignRawTransactionRequest{} + +// SignRawTransactionRequest struct for SignRawTransactionRequest +type SignRawTransactionRequest struct { + RawTransaction string `json:"rawTransaction"` + Mnemonic string `json:"mnemonic"` + SigningOptions map[string]interface{} `json:"signingOptions,omitempty"` +} + +// NewSignRawTransactionRequest instantiates a new SignRawTransactionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSignRawTransactionRequest(rawTransaction string, mnemonic string) *SignRawTransactionRequest { + this := SignRawTransactionRequest{} + this.RawTransaction = rawTransaction + this.Mnemonic = mnemonic + return &this +} + +// NewSignRawTransactionRequestWithDefaults instantiates a new SignRawTransactionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSignRawTransactionRequestWithDefaults() *SignRawTransactionRequest { + this := SignRawTransactionRequest{} + return &this +} + +// GetRawTransaction returns the RawTransaction field value +func (o *SignRawTransactionRequest) GetRawTransaction() string { + if o == nil { + var ret string + return ret + } + + return o.RawTransaction +} + +// GetRawTransactionOk returns a tuple with the RawTransaction field value +// and a boolean to check if the value has been set. +func (o *SignRawTransactionRequest) GetRawTransactionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RawTransaction, true +} + +// SetRawTransaction sets field value +func (o *SignRawTransactionRequest) SetRawTransaction(v string) { + o.RawTransaction = v +} + +// GetMnemonic returns the Mnemonic field value +func (o *SignRawTransactionRequest) GetMnemonic() string { + if o == nil { + var ret string + return ret + } + + return o.Mnemonic +} + +// GetMnemonicOk returns a tuple with the Mnemonic field value +// and a boolean to check if the value has been set. +func (o *SignRawTransactionRequest) GetMnemonicOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mnemonic, true +} + +// SetMnemonic sets field value +func (o *SignRawTransactionRequest) SetMnemonic(v string) { + o.Mnemonic = v +} + +// GetSigningOptions returns the SigningOptions field value if set, zero value otherwise. +func (o *SignRawTransactionRequest) GetSigningOptions() map[string]interface{} { + if o == nil || IsNil(o.SigningOptions) { + var ret map[string]interface{} + return ret + } + return o.SigningOptions +} + +// GetSigningOptionsOk returns a tuple with the SigningOptions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SignRawTransactionRequest) GetSigningOptionsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.SigningOptions) { + return map[string]interface{}{}, false + } + return o.SigningOptions, true +} + +// HasSigningOptions returns a boolean if a field has been set. +func (o *SignRawTransactionRequest) HasSigningOptions() bool { + if o != nil && !IsNil(o.SigningOptions) { + return true + } + + return false +} + +// SetSigningOptions gets a reference to the given map[string]interface{} and assigns it to the SigningOptions field. +func (o *SignRawTransactionRequest) SetSigningOptions(v map[string]interface{}) { + o.SigningOptions = v +} + +func (o SignRawTransactionRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SignRawTransactionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["rawTransaction"] = o.RawTransaction + toSerialize["mnemonic"] = o.Mnemonic + if !IsNil(o.SigningOptions) { + toSerialize["signingOptions"] = o.SigningOptions + } + return toSerialize, nil +} + +type NullableSignRawTransactionRequest struct { + value *SignRawTransactionRequest + isSet bool +} + +func (v NullableSignRawTransactionRequest) Get() *SignRawTransactionRequest { + return v.value +} + +func (v *NullableSignRawTransactionRequest) Set(val *SignRawTransactionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSignRawTransactionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSignRawTransactionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignRawTransactionRequest(val *SignRawTransactionRequest) *NullableSignRawTransactionRequest { + return &NullableSignRawTransactionRequest{value: val, isSet: true} +} + +func (v NullableSignRawTransactionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignRawTransactionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_response.go new file mode 100644 index 00000000000..b11a09b502b --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_sign_raw_transaction_response.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the SignRawTransactionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SignRawTransactionResponse{} + +// SignRawTransactionResponse struct for SignRawTransactionResponse +type SignRawTransactionResponse struct { + Success bool `json:"success"` + SignedTransaction string `json:"signedTransaction"` +} + +// NewSignRawTransactionResponse instantiates a new SignRawTransactionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSignRawTransactionResponse(success bool, signedTransaction string) *SignRawTransactionResponse { + this := SignRawTransactionResponse{} + this.Success = success + this.SignedTransaction = signedTransaction + return &this +} + +// NewSignRawTransactionResponseWithDefaults instantiates a new SignRawTransactionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSignRawTransactionResponseWithDefaults() *SignRawTransactionResponse { + this := SignRawTransactionResponse{} + return &this +} + +// GetSuccess returns the Success field value +func (o *SignRawTransactionResponse) 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 *SignRawTransactionResponse) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *SignRawTransactionResponse) SetSuccess(v bool) { + o.Success = v +} + +// GetSignedTransaction returns the SignedTransaction field value +func (o *SignRawTransactionResponse) 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 *SignRawTransactionResponse) GetSignedTransactionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignedTransaction, true +} + +// SetSignedTransaction sets field value +func (o *SignRawTransactionResponse) SetSignedTransaction(v string) { + o.SignedTransaction = v +} + +func (o SignRawTransactionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SignRawTransactionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["success"] = o.Success + toSerialize["signedTransaction"] = o.SignedTransaction + return toSerialize, nil +} + +type NullableSignRawTransactionResponse struct { + value *SignRawTransactionResponse + isSet bool +} + +func (v NullableSignRawTransactionResponse) Get() *SignRawTransactionResponse { + return v.value +} + +func (v *NullableSignRawTransactionResponse) Set(val *SignRawTransactionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSignRawTransactionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSignRawTransactionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignRawTransactionResponse(val *SignRawTransactionResponse) *NullableSignRawTransactionResponse { + return &NullableSignRawTransactionResponse{value: val, isSet: true} +} + +func (v NullableSignRawTransactionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignRawTransactionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_request.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_request.go new file mode 100644 index 00000000000..0f4981f0e05 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_request.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the TransactionInfoRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionInfoRequest{} + +// TransactionInfoRequest struct for TransactionInfoRequest +type TransactionInfoRequest struct { + AccountAddress string `json:"accountAddress"` + TransactionExpiration NullableFloat32 `json:"transactionExpiration"` +} + +// NewTransactionInfoRequest instantiates a new TransactionInfoRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionInfoRequest(accountAddress string, transactionExpiration NullableFloat32) *TransactionInfoRequest { + this := TransactionInfoRequest{} + this.AccountAddress = accountAddress + this.TransactionExpiration = transactionExpiration + return &this +} + +// NewTransactionInfoRequestWithDefaults instantiates a new TransactionInfoRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionInfoRequestWithDefaults() *TransactionInfoRequest { + this := TransactionInfoRequest{} + return &this +} + +// GetAccountAddress returns the AccountAddress field value +func (o *TransactionInfoRequest) GetAccountAddress() string { + if o == nil { + var ret string + return ret + } + + return o.AccountAddress +} + +// GetAccountAddressOk returns a tuple with the AccountAddress field value +// and a boolean to check if the value has been set. +func (o *TransactionInfoRequest) GetAccountAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountAddress, true +} + +// SetAccountAddress sets field value +func (o *TransactionInfoRequest) SetAccountAddress(v string) { + o.AccountAddress = v +} + +// GetTransactionExpiration returns the TransactionExpiration field value +// If the value is explicit nil, the zero value for float32 will be returned +func (o *TransactionInfoRequest) GetTransactionExpiration() float32 { + if o == nil || o.TransactionExpiration.Get() == nil { + var ret float32 + return ret + } + + return *o.TransactionExpiration.Get() +} + +// GetTransactionExpirationOk returns a tuple with the TransactionExpiration 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 *TransactionInfoRequest) GetTransactionExpirationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.TransactionExpiration.Get(), o.TransactionExpiration.IsSet() +} + +// SetTransactionExpiration sets field value +func (o *TransactionInfoRequest) SetTransactionExpiration(v float32) { + o.TransactionExpiration.Set(&v) +} + +func (o TransactionInfoRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionInfoRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accountAddress"] = o.AccountAddress + toSerialize["transactionExpiration"] = o.TransactionExpiration.Get() + return toSerialize, nil +} + +type NullableTransactionInfoRequest struct { + value *TransactionInfoRequest + isSet bool +} + +func (v NullableTransactionInfoRequest) Get() *TransactionInfoRequest { + return v.value +} + +func (v *NullableTransactionInfoRequest) Set(val *TransactionInfoRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionInfoRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionInfoRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionInfoRequest(val *TransactionInfoRequest) *NullableTransactionInfoRequest { + return &NullableTransactionInfoRequest{value: val, isSet: true} +} + +func (v NullableTransactionInfoRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionInfoRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response.go new file mode 100644 index 00000000000..4d7d51581b7 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the TransactionInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionInfoResponse{} + +// TransactionInfoResponse struct for TransactionInfoResponse +type TransactionInfoResponse struct { + ResponseContainer TransactionInfoResponseResponseContainer `json:"responseContainer"` +} + +// NewTransactionInfoResponse instantiates a new TransactionInfoResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionInfoResponse(responseContainer TransactionInfoResponseResponseContainer) *TransactionInfoResponse { + this := TransactionInfoResponse{} + this.ResponseContainer = responseContainer + return &this +} + +// NewTransactionInfoResponseWithDefaults instantiates a new TransactionInfoResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionInfoResponseWithDefaults() *TransactionInfoResponse { + this := TransactionInfoResponse{} + return &this +} + +// GetResponseContainer returns the ResponseContainer field value +func (o *TransactionInfoResponse) GetResponseContainer() TransactionInfoResponseResponseContainer { + if o == nil { + var ret TransactionInfoResponseResponseContainer + return ret + } + + return o.ResponseContainer +} + +// GetResponseContainerOk returns a tuple with the ResponseContainer field value +// and a boolean to check if the value has been set. +func (o *TransactionInfoResponse) GetResponseContainerOk() (*TransactionInfoResponseResponseContainer, bool) { + if o == nil { + return nil, false + } + return &o.ResponseContainer, true +} + +// SetResponseContainer sets field value +func (o *TransactionInfoResponse) SetResponseContainer(v TransactionInfoResponseResponseContainer) { + o.ResponseContainer = v +} + +func (o TransactionInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["responseContainer"] = o.ResponseContainer + return toSerialize, nil +} + +type NullableTransactionInfoResponse struct { + value *TransactionInfoResponse + isSet bool +} + +func (v NullableTransactionInfoResponse) Get() *TransactionInfoResponse { + return v.value +} + +func (v *NullableTransactionInfoResponse) Set(val *TransactionInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionInfoResponse(val *TransactionInfoResponse) *NullableTransactionInfoResponse { + return &NullableTransactionInfoResponse{value: val, isSet: true} +} + +func (v NullableTransactionInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_data.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_data.go new file mode 100644 index 00000000000..952f078ac9c --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_data.go @@ -0,0 +1,175 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the TransactionInfoResponseData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionInfoResponseData{} + +// TransactionInfoResponseData struct for TransactionInfoResponseData +type TransactionInfoResponseData struct { + Nonce map[string]interface{} `json:"nonce"` + BlockHash map[string]interface{} `json:"blockHash"` + Era map[string]interface{} `json:"era"` +} + +// NewTransactionInfoResponseData instantiates a new TransactionInfoResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionInfoResponseData(nonce map[string]interface{}, blockHash map[string]interface{}, era map[string]interface{}) *TransactionInfoResponseData { + this := TransactionInfoResponseData{} + this.Nonce = nonce + this.BlockHash = blockHash + this.Era = era + return &this +} + +// NewTransactionInfoResponseDataWithDefaults instantiates a new TransactionInfoResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionInfoResponseDataWithDefaults() *TransactionInfoResponseData { + this := TransactionInfoResponseData{} + return &this +} + +// GetNonce returns the Nonce field value +func (o *TransactionInfoResponseData) GetNonce() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + 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 *TransactionInfoResponseData) GetNonceOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Nonce, true +} + +// SetNonce sets field value +func (o *TransactionInfoResponseData) SetNonce(v map[string]interface{}) { + o.Nonce = v +} + +// GetBlockHash returns the BlockHash field value +func (o *TransactionInfoResponseData) GetBlockHash() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + 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 *TransactionInfoResponseData) GetBlockHashOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.BlockHash, true +} + +// SetBlockHash sets field value +func (o *TransactionInfoResponseData) SetBlockHash(v map[string]interface{}) { + o.BlockHash = v +} + +// GetEra returns the Era field value +// If the value is explicit nil, the zero value for map[string]interface{} will be returned +func (o *TransactionInfoResponseData) GetEra() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Era +} + +// GetEraOk returns a tuple with the Era 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 *TransactionInfoResponseData) GetEraOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Era) { + return map[string]interface{}{}, false + } + return o.Era, true +} + +// SetEra sets field value +func (o *TransactionInfoResponseData) SetEra(v map[string]interface{}) { + o.Era = v +} + +func (o TransactionInfoResponseData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionInfoResponseData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["nonce"] = o.Nonce + toSerialize["blockHash"] = o.BlockHash + if o.Era != nil { + toSerialize["era"] = o.Era + } + return toSerialize, nil +} + +type NullableTransactionInfoResponseData struct { + value *TransactionInfoResponseData + isSet bool +} + +func (v NullableTransactionInfoResponseData) Get() *TransactionInfoResponseData { + return v.value +} + +func (v *NullableTransactionInfoResponseData) Set(val *TransactionInfoResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionInfoResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionInfoResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionInfoResponseData(val *TransactionInfoResponseData) *NullableTransactionInfoResponseData { + return &NullableTransactionInfoResponseData{value: val, isSet: true} +} + +func (v NullableTransactionInfoResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionInfoResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_response_container.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_response_container.go new file mode 100644 index 00000000000..8d235f7a32a --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_transaction_info_response_response_container.go @@ -0,0 +1,200 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the TransactionInfoResponseResponseContainer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionInfoResponseResponseContainer{} + +// TransactionInfoResponseResponseContainer struct for TransactionInfoResponseResponseContainer +type TransactionInfoResponseResponseContainer struct { + ResponseData TransactionInfoResponseData `json:"response_data"` + Succeeded bool `json:"succeeded"` + Message string `json:"message"` + Error NullableString `json:"error"` +} + +// NewTransactionInfoResponseResponseContainer instantiates a new TransactionInfoResponseResponseContainer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionInfoResponseResponseContainer(responseData TransactionInfoResponseData, succeeded bool, message string, error_ NullableString) *TransactionInfoResponseResponseContainer { + this := TransactionInfoResponseResponseContainer{} + this.ResponseData = responseData + this.Succeeded = succeeded + this.Message = message + this.Error = error_ + return &this +} + +// NewTransactionInfoResponseResponseContainerWithDefaults instantiates a new TransactionInfoResponseResponseContainer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionInfoResponseResponseContainerWithDefaults() *TransactionInfoResponseResponseContainer { + this := TransactionInfoResponseResponseContainer{} + return &this +} + +// GetResponseData returns the ResponseData field value +func (o *TransactionInfoResponseResponseContainer) GetResponseData() TransactionInfoResponseData { + if o == nil { + var ret TransactionInfoResponseData + return ret + } + + return o.ResponseData +} + +// GetResponseDataOk returns a tuple with the ResponseData field value +// and a boolean to check if the value has been set. +func (o *TransactionInfoResponseResponseContainer) GetResponseDataOk() (*TransactionInfoResponseData, bool) { + if o == nil { + return nil, false + } + return &o.ResponseData, true +} + +// SetResponseData sets field value +func (o *TransactionInfoResponseResponseContainer) SetResponseData(v TransactionInfoResponseData) { + o.ResponseData = v +} + +// GetSucceeded returns the Succeeded field value +func (o *TransactionInfoResponseResponseContainer) GetSucceeded() bool { + if o == nil { + var ret bool + return ret + } + + return o.Succeeded +} + +// GetSucceededOk returns a tuple with the Succeeded field value +// and a boolean to check if the value has been set. +func (o *TransactionInfoResponseResponseContainer) GetSucceededOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Succeeded, true +} + +// SetSucceeded sets field value +func (o *TransactionInfoResponseResponseContainer) SetSucceeded(v bool) { + o.Succeeded = v +} + +// GetMessage returns the Message field value +func (o *TransactionInfoResponseResponseContainer) 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 *TransactionInfoResponseResponseContainer) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *TransactionInfoResponseResponseContainer) SetMessage(v string) { + o.Message = v +} + +// GetError returns the Error field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TransactionInfoResponseResponseContainer) GetError() string { + if o == nil || o.Error.Get() == nil { + var ret string + return ret + } + + return *o.Error.Get() +} + +// GetErrorOk returns a tuple with the Error 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 *TransactionInfoResponseResponseContainer) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Error.Get(), o.Error.IsSet() +} + +// SetError sets field value +func (o *TransactionInfoResponseResponseContainer) SetError(v string) { + o.Error.Set(&v) +} + +func (o TransactionInfoResponseResponseContainer) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionInfoResponseResponseContainer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["response_data"] = o.ResponseData + toSerialize["succeeded"] = o.Succeeded + toSerialize["message"] = o.Message + toSerialize["error"] = o.Error.Get() + return toSerialize, nil +} + +type NullableTransactionInfoResponseResponseContainer struct { + value *TransactionInfoResponseResponseContainer + isSet bool +} + +func (v NullableTransactionInfoResponseResponseContainer) Get() *TransactionInfoResponseResponseContainer { + return v.value +} + +func (v *NullableTransactionInfoResponseResponseContainer) Set(val *TransactionInfoResponseResponseContainer) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionInfoResponseResponseContainer) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionInfoResponseResponseContainer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionInfoResponseResponseContainer(val *TransactionInfoResponseResponseContainer) *NullableTransactionInfoResponseResponseContainer { + return &NullableTransactionInfoResponseResponseContainer{value: val, isSet: true} +} + +func (v NullableTransactionInfoResponseResponseContainer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionInfoResponseResponseContainer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go new file mode 100644 index 00000000000..790587adb58 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential.go @@ -0,0 +1,178 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredential - struct for Web3SigningCredential +type Web3SigningCredential struct { + Web3SigningCredentialCactusKeychainRef *Web3SigningCredentialCactusKeychainRef + Web3SigningCredentialMnemonicString *Web3SigningCredentialMnemonicString + Web3SigningCredentialNone *Web3SigningCredentialNone +} + +// Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialCactusKeychainRef wrapped in Web3SigningCredential +func Web3SigningCredentialCactusKeychainRefAsWeb3SigningCredential(v *Web3SigningCredentialCactusKeychainRef) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialCactusKeychainRef: v, + } +} + +// Web3SigningCredentialMnemonicStringAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialMnemonicString wrapped in Web3SigningCredential +func Web3SigningCredentialMnemonicStringAsWeb3SigningCredential(v *Web3SigningCredentialMnemonicString) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialMnemonicString: v, + } +} + +// Web3SigningCredentialNoneAsWeb3SigningCredential is a convenience function that returns Web3SigningCredentialNone wrapped in Web3SigningCredential +func Web3SigningCredentialNoneAsWeb3SigningCredential(v *Web3SigningCredentialNone) Web3SigningCredential { + return Web3SigningCredential{ + Web3SigningCredentialNone: 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 Web3SigningCredentialMnemonicString + err = newStrictDecoder(data).Decode(&dst.Web3SigningCredentialMnemonicString) + if err == nil { + jsonWeb3SigningCredentialMnemonicString, _ := json.Marshal(dst.Web3SigningCredentialMnemonicString) + if string(jsonWeb3SigningCredentialMnemonicString) == "{}" { // empty struct + dst.Web3SigningCredentialMnemonicString = nil + } else { + match++ + } + } else { + dst.Web3SigningCredentialMnemonicString = 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 + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Web3SigningCredentialCactusKeychainRef = nil + dst.Web3SigningCredentialMnemonicString = nil + dst.Web3SigningCredentialNone = 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.Web3SigningCredentialMnemonicString != nil { + return json.Marshal(&src.Web3SigningCredentialMnemonicString) + } + + if src.Web3SigningCredentialNone != nil { + return json.Marshal(&src.Web3SigningCredentialNone) + } + + 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.Web3SigningCredentialMnemonicString != nil { + return obj.Web3SigningCredentialMnemonicString + } + + if obj.Web3SigningCredentialNone != nil { + return obj.Web3SigningCredentialNone + } + + // 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-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go new file mode 100644 index 00000000000..7b430ae5923 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_cactus_keychain_ref.go @@ -0,0 +1,173 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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 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, keychainEntryKey string, keychainId string) *Web3SigningCredentialCactusKeychainRef { + this := Web3SigningCredentialCactusKeychainRef{} + this.Type = type_ + 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 +} + +// 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["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-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_mnemonic_string.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_mnemonic_string.go new file mode 100644 index 00000000000..8c071eaa6b9 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_mnemonic_string.go @@ -0,0 +1,145 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" +) + +// checks if the Web3SigningCredentialMnemonicString type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Web3SigningCredentialMnemonicString{} + +// Web3SigningCredentialMnemonicString struct for Web3SigningCredentialMnemonicString +type Web3SigningCredentialMnemonicString struct { + Type Web3SigningCredentialType `json:"type"` + // The Polkadot account's seed phrase for signing transaction + Mnemonic string `json:"mnemonic"` +} + +// NewWeb3SigningCredentialMnemonicString instantiates a new Web3SigningCredentialMnemonicString object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWeb3SigningCredentialMnemonicString(type_ Web3SigningCredentialType, mnemonic string) *Web3SigningCredentialMnemonicString { + this := Web3SigningCredentialMnemonicString{} + this.Type = type_ + this.Mnemonic = mnemonic + return &this +} + +// NewWeb3SigningCredentialMnemonicStringWithDefaults instantiates a new Web3SigningCredentialMnemonicString object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWeb3SigningCredentialMnemonicStringWithDefaults() *Web3SigningCredentialMnemonicString { + this := Web3SigningCredentialMnemonicString{} + return &this +} + +// GetType returns the Type field value +func (o *Web3SigningCredentialMnemonicString) 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 *Web3SigningCredentialMnemonicString) GetTypeOk() (*Web3SigningCredentialType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Web3SigningCredentialMnemonicString) SetType(v Web3SigningCredentialType) { + o.Type = v +} + +// GetMnemonic returns the Mnemonic field value +func (o *Web3SigningCredentialMnemonicString) GetMnemonic() string { + if o == nil { + var ret string + return ret + } + + return o.Mnemonic +} + +// GetMnemonicOk returns a tuple with the Mnemonic field value +// and a boolean to check if the value has been set. +func (o *Web3SigningCredentialMnemonicString) GetMnemonicOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mnemonic, true +} + +// SetMnemonic sets field value +func (o *Web3SigningCredentialMnemonicString) SetMnemonic(v string) { + o.Mnemonic = v +} + +func (o Web3SigningCredentialMnemonicString) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Web3SigningCredentialMnemonicString) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["mnemonic"] = o.Mnemonic + return toSerialize, nil +} + +type NullableWeb3SigningCredentialMnemonicString struct { + value *Web3SigningCredentialMnemonicString + isSet bool +} + +func (v NullableWeb3SigningCredentialMnemonicString) Get() *Web3SigningCredentialMnemonicString { + return v.value +} + +func (v *NullableWeb3SigningCredentialMnemonicString) Set(val *Web3SigningCredentialMnemonicString) { + v.value = val + v.isSet = true +} + +func (v NullableWeb3SigningCredentialMnemonicString) IsSet() bool { + return v.isSet +} + +func (v *NullableWeb3SigningCredentialMnemonicString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWeb3SigningCredentialMnemonicString(val *Web3SigningCredentialMnemonicString) *NullableWeb3SigningCredentialMnemonicString { + return &NullableWeb3SigningCredentialMnemonicString{value: val, isSet: true} +} + +func (v NullableWeb3SigningCredentialMnemonicString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWeb3SigningCredentialMnemonicString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go new file mode 100644 index 00000000000..b39b0ed6fad --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_none.go @@ -0,0 +1,117 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go new file mode 100644 index 00000000000..08b128aa762 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/model_web3_signing_credential_type.go @@ -0,0 +1,113 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +import ( + "encoding/json" + "fmt" +) + +// Web3SigningCredentialType the model 'Web3SigningCredentialType' +type Web3SigningCredentialType string + +// List of Web3SigningCredentialType +const ( + CACTUS_KEYCHAIN_REF Web3SigningCredentialType = "CACTUS_KEYCHAIN_REF" + MNEMONIC_STRING Web3SigningCredentialType = "MNEMONIC_STRING" + NONE Web3SigningCredentialType = "NONE" +) + +// All allowed values of Web3SigningCredentialType enum +var AllowedWeb3SigningCredentialTypeEnumValues = []Web3SigningCredentialType{ + "CACTUS_KEYCHAIN_REF", + "MNEMONIC_STRING", + "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-polkadot/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..37b830ee723 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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-polkadot/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..bce94760038 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,109 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-ledger-connector-polkadot + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-ledger-connector-polkadot_DefaultApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DefaultApiService DeployContractInk", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.DeployContractInk(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetPrometheusMetrics", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetPrometheusMetrics(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetRawTransaction", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetRawTransaction(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService GetTransactionInfo", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.GetTransactionInfo(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService InvokeContract", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.InvokeContract(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService RunTransaction", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.RunTransaction(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DefaultApiService SignRawTransaction", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DefaultApi.SignRawTransaction(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-polkadot/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..50b828fa77e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-polkadot/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Connector Polkadot + +Can perform basic tasks on a Polkadot parachain + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-polkadot + +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/package.json b/packages/cactus-plugin-ledger-connector-sawtooth/package.json index cf2589ab911..27c485c5f63 100644 --- a/packages/cactus-plugin-ledger-connector-sawtooth/package.json +++ b/packages/cactus-plugin-ledger-connector-sawtooth/package.json @@ -44,9 +44,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "webpack": "npm-run-all webpack:dev", 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..2359ad743b3 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,27 @@ +.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 +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..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/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-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..7c5b6870046 --- /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: 2.0.0-rc.3 +- 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..9094b00e94f --- /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: 2.0.0-rc.3 +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..199848dedbd --- /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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-ledger-connector-sawtooth + +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 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 := 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-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..e9736347381 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-sawtooth/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cacti Plugin - Connector Sawtooth + +Can perform basic tasks on a Sawtooth ledger + +API version: 2.0.0-rc.3 +*/ + +// 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" + "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 v2.0.0-rc.3 +// 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-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..0c6d03ee971 --- /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: 2.0.0-rc.3 +*/ + +// 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..205d553563d --- /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.18 + +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..c3e95114dbd --- /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: 2.0.0-rc.3 +*/ + +// 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..86e8ad2b3b2 --- /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: 2.0.0-rc.3 +*/ + +// 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..04164239222 --- /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: 2.0.0-rc.3 +*/ + +// 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..93b23812849 --- /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: 2.0.0-rc.3 +*/ + +// 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..f5dcc474501 --- /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: 2.0.0-rc.3 +*/ + +// 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..c7b4e5bba67 --- /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: 2.0.0-rc.3 +*/ + +// 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..2012b23ce1d --- /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: 2.0.0-rc.3 +*/ + +// 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..1d41e867703 --- /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: 2.0.0-rc.3 +*/ + +// 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..5222c4dbab3 --- /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: 2.0.0-rc.3 +*/ + +// 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..f2cbcbd40c6 --- /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: 2.0.0-rc.3 +*/ + +// 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..407b4bf0add --- /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: 2.0.0-rc.3 +*/ + +// 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..b7bf46bb089 --- /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: 2.0.0-rc.3 +*/ + +// 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..ce17342ef40 --- /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: 2.0.0-rc.3 +*/ + +// 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..395278eaaf2 --- /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: 2.0.0-rc.3 +*/ + +// 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..c8386917c80 --- /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: 2.0.0-rc.3 +*/ + +// 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..d967b464bca --- /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: 2.0.0-rc.3 +*/ + +// 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..8720f1bc27c --- /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: 2.0.0-rc.3 +*/ + +// 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..b08ac79dfd7 --- /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: 2.0.0-rc.3 +*/ + +// 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..8e0c7af8a09 --- /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: 2.0.0-rc.3 +*/ + +// 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-xdai/package.json b/packages/cactus-plugin-ledger-connector-xdai/package.json index 553aa1e8868..674492c262b 100644 --- a/packages/cactus-plugin-ledger-connector-xdai/package.json +++ b/packages/cactus-plugin-ledger-connector-xdai/package.json @@ -43,9 +43,10 @@ "dist/*" ], "scripts": { - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "watch": "npm-watch", "webpack": "npm-run-all webpack:dev", 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..749646c9b94 --- /dev/null +++ b/packages/cactus-plugin-ledger-connector-xdai/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,37 @@ +.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 +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..bb0b01f00c1 --- /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: 2.0.0-rc.3 +- 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..1ca84de8973 --- /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: 2.0.0-rc.3 +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..826766adfa4 --- /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: 2.0.0-rc.3 +*/ + +// 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..0f786b64060 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..e105c7aa747 --- /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: 2.0.0-rc.3 +*/ + +// 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..2761fe3b077 --- /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: 2.0.0-rc.3 +*/ + +// 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..aecbdec5930 --- /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: 2.0.0-rc.3 +*/ + +// 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..ef2cca5b437 --- /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: 2.0.0-rc.3 +*/ + +// 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..5e54ad26938 --- /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: 2.0.0-rc.3 +*/ + +// 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..aa6db39ba1f --- /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: 2.0.0-rc.3 +*/ + +// 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..ee181a40e81 --- /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: 2.0.0-rc.3 +*/ + +// 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..1f113173f5e --- /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: 2.0.0-rc.3 +*/ + +// 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..200ed5b4c11 --- /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: 2.0.0-rc.3 +*/ + +// 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..51bcebf5d6d --- /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: 2.0.0-rc.3 +*/ + +// 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..dcc0148d9c1 --- /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: 2.0.0-rc.3 +*/ + +// 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..e1fe75ddd1a --- /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: 2.0.0-rc.3 +*/ + +// 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..edfc30bd2bb --- /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: 2.0.0-rc.3 +*/ + +// 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..066bf94912c --- /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: 2.0.0-rc.3 +*/ + +// 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..4132602fcbd --- /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: 2.0.0-rc.3 +*/ + +// 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..2e9724fc584 --- /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: 2.0.0-rc.3 +*/ + +// 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..f4f3f97f246 --- /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: 2.0.0-rc.3 +*/ + +// 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..967902b5560 --- /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: 2.0.0-rc.3 +*/ + +// 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..d3f3f28890a --- /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: 2.0.0-rc.3 +*/ + +// 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..b259b86848a --- /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: 2.0.0-rc.3 +*/ + +// 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..7e9c0eddcab --- /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: 2.0.0-rc.3 +*/ + +// 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..9ecbfa5b11b --- /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: 2.0.0-rc.3 +*/ + +// 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..5eaecaab69c --- /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: 2.0.0-rc.3 +*/ + +// 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..feb95031e65 --- /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: 2.0.0-rc.3 +*/ + +// 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..b8b82848083 --- /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: 2.0.0-rc.3 +*/ + +// 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..a03bffb8299 --- /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: 2.0.0-rc.3 +*/ + +// 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..d5c063ee970 --- /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: 2.0.0-rc.3 +*/ + +// 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..f1c22342cfb --- /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: 2.0.0-rc.3 +*/ + +// 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..23ba5b343c0 --- /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: 2.0.0-rc.3 +*/ + +// 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..e8326fc51d1 --- /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: 2.0.0-rc.3 +*/ + +// 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-persistence-ethereum/package.json b/packages/cactus-plugin-persistence-ethereum/package.json index 7865076f11e..be47c38e046 100644 --- a/packages/cactus-plugin-persistence-ethereum/package.json +++ b/packages/cactus-plugin-persistence-ethereum/package.json @@ -50,11 +50,13 @@ "build": "npm run build-ts && npm run build:dev:backend:postbuild", "build-ts": "tsc", "build:dev:backend:postbuild": "npm run copy-sql && npm run copy-yarn-lock", - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "copy-sql": "mkdir -p ./dist/lib/main/ && cp -Rfp ./src/main/sql ./dist/lib/main/", "copy-yarn-lock": "mkdir -p ./dist/lib/ && cp -rfp ../../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" }, "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..69890fbb6c7 --- /dev/null +++ b/packages/cactus-plugin-persistence-ethereum/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_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 +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..977a3b234df --- /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: 2.0.0-rc.3 +- 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..d429b44503d --- /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: 2.0.0-rc.3 +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..325dcf2d384 --- /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: 2.0.0-rc.3 +*/ + +// 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..83fb08916d6 --- /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: 2.0.0-rc.3 +*/ + +// 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 v2.0.0-rc.3 +// 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..edddad2644f --- /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: 2.0.0-rc.3 +*/ + +// 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..bbac1418789 --- /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: 2.0.0-rc.3 +*/ + +// 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..26e0b9c4da6 --- /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: 2.0.0-rc.3 +*/ + +// 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..c6ce801132e --- /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: 2.0.0-rc.3 +*/ + +// 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..892e5cbf51d --- /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: 2.0.0-rc.3 +*/ + +// 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..6bb6c71a98a --- /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: 2.0.0-rc.3 +*/ + +// 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..c1961db0fd6 --- /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: 2.0.0-rc.3 +*/ + +// 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..37608ce47b3 --- /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: 2.0.0-rc.3 +*/ + +// 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-fabric/package.json b/packages/cactus-plugin-persistence-fabric/package.json index 8fbb5be84da..a223d115b86 100644 --- a/packages/cactus-plugin-persistence-fabric/package.json +++ b/packages/cactus-plugin-persistence-fabric/package.json @@ -49,9 +49,13 @@ "scripts": { "build": "npm run build-ts", "build-ts": "tsc", - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s '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" + "copy-yarn-lock": "cp -af ../../yarn.lock ./dist/yarn.lock", + "generate-sdk": "run-p 'generate-sdk:*'", + "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:typecript-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", + "watch": "npm-watch" }, "dependencies": { "@hyperledger/cactus-common": "2.0.0-rc.3", 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..9bb625d9422 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,13 @@ +.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_status_response_v1.go +model_tracked_operation_v1.go +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..7d49d347cf1 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,114 @@ +# Go API client for cactus-plugin-persistence-fabric + +Synchronizes state of an fabric 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: 2.0.0-rc.3 +- 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 +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**GetStatusV1**](docs/DefaultApi.md#getstatusv1) | **Get** /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/status | Get the status of persistence plugin for fabric + + +## Documentation For Models + + - [ErrorExceptionResponseV1](docs/ErrorExceptionResponseV1.md) + - [StatusResponseV1](docs/StatusResponseV1.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-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..56e51b341f1 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml @@ -0,0 +1,113 @@ +openapi: 3.0.3 +info: + description: Synchronizes state of an fabric 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 Fabric + version: 2.0.0-rc.3 +servers: +- url: / +paths: + /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/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 fabric + x-hyperledger-cacti: + http: + verbLowerCase: get + path: /api/v1/plugins/@hyperledger/cactus-plugin-persistence-fabric/status +components: + schemas: + 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 + instanceId: instanceId + lastSeenBlock: 0.8008281904610115 + 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 + 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 + - 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-fabric/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..8d5d10861de --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/api_default.go @@ -0,0 +1,130 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +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 fabric + + @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-fabric/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-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..01091578728 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/client.go @@ -0,0 +1,656 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// 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 - Persistence Fabric API v2.0.0-rc.3 +// 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-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..121299c84ab --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/configuration.go @@ -0,0 +1,215 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// 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/model_error_exception_response_v1.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go new file mode 100644 index 00000000000..750fa41ce56 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_error_exception_response_v1.go @@ -0,0 +1,144 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-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-persistence-fabric/src/main/go/generated/openapi/go-client/model_status_response_v1.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_status_response_v1.go new file mode 100644 index 00000000000..2a6e750598d --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_status_response_v1.go @@ -0,0 +1,257 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +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"` + 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, operationsRunning []TrackedOperationV1, monitorRunning bool, lastSeenBlock float32) *StatusResponseV1 { + this := StatusResponseV1{} + this.InstanceId = instanceId + this.Connected = connected + this.WebServicesRegistered = webServicesRegistered + 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 +} + +// 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["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-fabric/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go new file mode 100644 index 00000000000..9bb861788a0 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/model_tracked_operation_v1.go @@ -0,0 +1,146 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-persistence-fabric + +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-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..441b791f12b --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/response.go @@ -0,0 +1,47 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// 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/test/api_default_test.go b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..ce268821bf4 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/test/api_default_test.go @@ -0,0 +1,37 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Testing DefaultApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package cactus-plugin-persistence-fabric + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-persistence-fabric_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-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..693ba6bd719 --- /dev/null +++ b/packages/cactus-plugin-persistence-fabric/src/main/go/generated/openapi/go-client/utils.go @@ -0,0 +1,347 @@ +/* +Hyperledger Cactus Plugin - Persistence Fabric + +Synchronizes state of an fabric ledger into a DB that can later be viewed in GUI + +API version: 2.0.0-rc.3 +*/ + +// 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-satp-hermes/package.json b/packages/cactus-plugin-satp-hermes/package.json index 1a63b6a84b2..3ee1fa3c153 100644 --- a/packages/cactus-plugin-satp-hermes/package.json +++ b/packages/cactus-plugin-satp-hermes/package.json @@ -39,9 +39,10 @@ ], "scripts": { "build:dev:backend:postbuild": "mkdir -p ./dist/lib/main/knex && cp -r ./knex/* ./dist/lib/main/knex", - "codegen": "run-p 'codegen:*'", + "codegen": "yarn run --top-level run-s 'codegen:*'", "codegen:openapi": "npm run generate-sdk", "generate-sdk": "run-p 'generate-sdk:*'", + "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: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", "pretsc": "npm run generate-sdk", diff --git a/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES new file mode 100644 index 00000000000..87c8b5f704c --- /dev/null +++ b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/FILES @@ -0,0 +1,37 @@ +.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_local_log.go +model_lock_evidence_v1_request.go +model_lock_evidence_v1_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_satp_message.go +model_satp_message_action_response.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 +utils.go diff --git a/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..cd802a1ec4e --- /dev/null +++ b/packages/cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/.travis.yml b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/packages/cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/README.md b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/README.md new file mode 100644 index 00000000000..52057b4ba99 --- /dev/null +++ b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/README.md @@ -0,0 +1,155 @@ +# Go API client for cactus-plugin-satp-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: 2.0.0-rc.3 +- 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-satp-hermes "github.com/hyperledger/cactus-plugin-satp-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-satp-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-satp-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-satp-hermes.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), cactus-plugin-satp-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-satp-hermes/clientrequest | +*DefaultApi* | [**Phase1TransferInitiationRequestV1**](docs/DefaultApi.md#phase1transferinitiationrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase1/transferinitiationrequest | +*DefaultApi* | [**Phase1TransferInitiationResponseV1**](docs/DefaultApi.md#phase1transferinitiationresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase1/transferinitiationresponse | +*DefaultApi* | [**Phase2LockEvidenceRequestV1**](docs/DefaultApi.md#phase2lockevidencerequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase2/lockevidencerequest | +*DefaultApi* | [**Phase2LockEvidenceResponseV1**](docs/DefaultApi.md#phase2lockevidenceresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase2/lockevidenceresponse | +*DefaultApi* | [**Phase2TransferCommenceRequestV1**](docs/DefaultApi.md#phase2transfercommencerequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase2/transfercommencerequest | +*DefaultApi* | [**Phase2TransferCommenceResponseV1**](docs/DefaultApi.md#phase2transfercommenceresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase2/transfercommenceresponse | +*DefaultApi* | [**Phase3CommitFinalRequestV1**](docs/DefaultApi.md#phase3commitfinalrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase3/commitfinalrequest | +*DefaultApi* | [**Phase3CommitFinalResponseV1**](docs/DefaultApi.md#phase3commitfinalresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase3/commitfinalresponse | +*DefaultApi* | [**Phase3CommitPreparationRequestV1**](docs/DefaultApi.md#phase3commitpreparationrequestv1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase3/commitpreparationrequest | +*DefaultApi* | [**Phase3CommitPreparationResponseV1**](docs/DefaultApi.md#phase3commitpreparationresponsev1) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase3/commitpreparationresponse | +*DefaultApi* | [**Phase3TransferCompleteRequestV1**](docs/DefaultApi.md#phase3transfercompleterequestv1) | **Get** /api/v1/@hyperledger/cactus-plugin-satp-hermes/phase3/transfercompleterequest | +*DefaultApi* | [**RecoverUpdateAckV1Message**](docs/DefaultApi.md#recoverupdateackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/recoverupdateackmessage | +*DefaultApi* | [**RecoverUpdateV1Message**](docs/DefaultApi.md#recoverupdatev1message) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/recoverupdatemessage | +*DefaultApi* | [**RecoverV1Message**](docs/DefaultApi.md#recoverv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/recovermessage | +*DefaultApi* | [**RecoverV1Success**](docs/DefaultApi.md#recoverv1success) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/recoversuccessmessage | +*DefaultApi* | [**RollbackAckV1Message**](docs/DefaultApi.md#rollbackackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-hermes/rollbackackmessage | +*DefaultApi* | [**RollbackV1Message**](docs/DefaultApi.md#rollbackv1message) | **Post** /api/v1/@hyperledger/cactus-plugin-satp-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) + - [LocalLog](docs/LocalLog.md) + - [LockEvidenceV1Request](docs/LockEvidenceV1Request.md) + - [LockEvidenceV1Response](docs/LockEvidenceV1Response.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) + - [SatpMessage](docs/SatpMessage.md) + - [SatpMessageActionResponse](docs/SatpMessageActionResponse.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-satp-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/api/openapi.yaml new file mode 100644 index 00000000000..ab3a2f2d083 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +servers: +- url: / +paths: + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase1/transferinitiationrequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase2/transfercommencerequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase2/lockevidencerequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase3/commitpreparationrequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase3/commitfinalrequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase3/transfercompleterequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/clientrequest + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase1/transferinitiationresponse + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase2/transfercommenceresponse + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase2/lockevidenceresponse + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase3/commitpreparationresponse + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/phase3/commitfinalresponse + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/recovermessage + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/recoverupdatemessage + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/recoverupdateackmessage + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/recoversuccessmessage + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-hermes/rollbackmessage + /api/v1/@hyperledger/cactus-plugin-satp-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-satp-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/LocalLog' + 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 + LocalLog: + 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 + SatpMessage: + properties: + SequenceNumber: + type: number + Phase: + enum: + - TransferInitialization + - LockEvidenceVerification + - CommitmentEstablishment + type: string + ResourceURL: + type: string + DeveloperURN: + type: string + ActionResponse: + $ref: '#/components/schemas/SatpMessage_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 + SatpMessage_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-satp-hermes/src/main/go/generated/openapi/go-client/api_default.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/api_default.go new file mode 100644 index 00000000000..5c06faa0224 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/client.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/client.go new file mode 100644 index 00000000000..addd80b54d1 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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 v2.0.0-rc.3 +// 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-satp-hermes/src/main/go/generated/openapi/go-client/configuration.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/configuration.go new file mode 100644 index 00000000000..6c01c6762b7 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/go.mod b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/go.mod new file mode 100644 index 00000000000..eb0c2317be6 --- /dev/null +++ b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/go.mod @@ -0,0 +1,6 @@ +module github.com/hyperledger/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client + +go 1.18 + +require ( +) diff --git a/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/go.sum b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/go.sum new file mode 100644 index 00000000000..c966c8ddfd0 --- /dev/null +++ b/packages/cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_asset_profile.go new file mode 100644 index 00000000000..10ad3cb5867 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request.go new file mode 100644 index 00000000000..c741e31ca0c --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_client_v1_request_client_gateway_configuration.go new file mode 100644 index 00000000000..8c7c5c789d1 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_request.go new file mode 100644 index 00000000000..c7d0e170058 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_final_v1_response.go new file mode 100644 index 00000000000..89968d0c8a1 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_request.go new file mode 100644 index 00000000000..400c84a67d7 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_commit_preparation_v1_response.go new file mode 100644 index 00000000000..39460d3b506 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_credential_profile.go new file mode 100644 index 00000000000..792f75eacd2 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_history.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_history.go new file mode 100644 index 00000000000..1976766cad3 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_local_log.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_local_log.go new file mode 100644 index 00000000000..6c2c0c003f0 --- /dev/null +++ b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_local_log.go @@ -0,0 +1,279 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-hermes + +import ( + "encoding/json" +) + +// checks if the LocalLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LocalLog{} + +// LocalLog struct for LocalLog +type LocalLog 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"` +} + +// NewLocalLog instantiates a new LocalLog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLocalLog(sessionID string, type_ string, operation string) *LocalLog { + this := LocalLog{} + this.SessionID = sessionID + this.Type = type_ + this.Operation = operation + return &this +} + +// NewLocalLogWithDefaults instantiates a new LocalLog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLocalLogWithDefaults() *LocalLog { + this := LocalLog{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *LocalLog) 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 *LocalLog) 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 *LocalLog) 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 *LocalLog) SetKey(v string) { + o.Key = &v +} + +// GetSessionID returns the SessionID field value +func (o *LocalLog) 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 *LocalLog) GetSessionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionID, true +} + +// SetSessionID sets field value +func (o *LocalLog) SetSessionID(v string) { + o.SessionID = v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *LocalLog) 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 *LocalLog) 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 *LocalLog) 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 *LocalLog) SetData(v string) { + o.Data = &v +} + +// GetType returns the Type field value +func (o *LocalLog) 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 *LocalLog) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LocalLog) SetType(v string) { + o.Type = v +} + +// GetOperation returns the Operation field value +func (o *LocalLog) 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 *LocalLog) GetOperationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Operation, true +} + +// SetOperation sets field value +func (o *LocalLog) SetOperation(v string) { + o.Operation = v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *LocalLog) 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 *LocalLog) 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 *LocalLog) 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 *LocalLog) SetTimestamp(v string) { + o.Timestamp = &v +} + +func (o LocalLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LocalLog) 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 NullableLocalLog struct { + value *LocalLog + isSet bool +} + +func (v NullableLocalLog) Get() *LocalLog { + return v.value +} + +func (v *NullableLocalLog) Set(val *LocalLog) { + v.value = val + v.isSet = true +} + +func (v NullableLocalLog) IsSet() bool { + return v.isSet +} + +func (v *NullableLocalLog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLocalLog(val *LocalLog) *NullableLocalLog { + return &NullableLocalLog{value: val, isSet: true} +} + +func (v NullableLocalLog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLocalLog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_request.go new file mode 100644 index 00000000000..589c6421dfd --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_lock_evidence_v1_response.go new file mode 100644 index 00000000000..661400e73c5 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_payload_profile.go new file mode 100644 index 00000000000..76aed86eee1 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_success_v1_message.go new file mode 100644 index 00000000000..7e53a1fc8c8 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_update_ack_v1_message.go new file mode 100644 index 00000000000..478db70c29d --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_update_v1_message.go new file mode 100644 index 00000000000..75166d45812 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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 []LocalLog `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 []LocalLog, 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() []LocalLog { + if o == nil { + var ret []LocalLog + 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() ([]LocalLog, bool) { + if o == nil { + return nil, false + } + return o.RecoveredLogs, true +} + +// SetRecoveredLogs sets field value +func (o *RecoverUpdateV1Message) SetRecoveredLogs(v []LocalLog) { + 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-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_recover_v1_message.go new file mode 100644 index 00000000000..6241a1e789d --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_rollback_ack_v1_message.go new file mode 100644 index 00000000000..0e148a157d8 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_rollback_v1_message.go new file mode 100644 index 00000000000..80826cba1b5 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message.go new file mode 100644 index 00000000000..7bfc8f11f39 --- /dev/null +++ b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message.go @@ -0,0 +1,522 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-hermes + +import ( + "encoding/json" +) + +// checks if the SatpMessage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SatpMessage{} + +// SatpMessage struct for SatpMessage +type SatpMessage struct { + SequenceNumber *float32 `json:"SequenceNumber,omitempty"` + Phase *string `json:"Phase,omitempty"` + ResourceURL *string `json:"ResourceURL,omitempty"` + DeveloperURN *string `json:"DeveloperURN,omitempty"` + ActionResponse *SatpMessageActionResponse `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"` +} + +// NewSatpMessage instantiates a new SatpMessage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSatpMessage() *SatpMessage { + this := SatpMessage{} + return &this +} + +// NewSatpMessageWithDefaults instantiates a new SatpMessage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSatpMessageWithDefaults() *SatpMessage { + this := SatpMessage{} + return &this +} + +// GetSequenceNumber returns the SequenceNumber field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetSequenceNumber(v float32) { + o.SequenceNumber = &v +} + +// GetPhase returns the Phase field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetPhase(v string) { + o.Phase = &v +} + +// GetResourceURL returns the ResourceURL field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetResourceURL(v string) { + o.ResourceURL = &v +} + +// GetDeveloperURN returns the DeveloperURN field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetDeveloperURN(v string) { + o.DeveloperURN = &v +} + +// GetActionResponse returns the ActionResponse field value if set, zero value otherwise. +func (o *SatpMessage) GetActionResponse() SatpMessageActionResponse { + if o == nil || IsNil(o.ActionResponse) { + var ret SatpMessageActionResponse + 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 *SatpMessage) GetActionResponseOk() (*SatpMessageActionResponse, 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 *SatpMessage) HasActionResponse() bool { + if o != nil && !IsNil(o.ActionResponse) { + return true + } + + return false +} + +// SetActionResponse gets a reference to the given SatpMessageActionResponse and assigns it to the ActionResponse field. +func (o *SatpMessage) SetActionResponse(v SatpMessageActionResponse) { + o.ActionResponse = &v +} + +// GetCredentialProfile returns the CredentialProfile field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetCredentialProfile(v string) { + o.CredentialProfile = &v +} + +// GetCredentialBlock returns the CredentialBlock field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetCredentialBlock(v []interface{}) { + o.CredentialBlock = v +} + +// GetCredentialsProfile returns the CredentialsProfile field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetCredentialsProfile(v PayloadProfile) { + o.CredentialsProfile = &v +} + +// GetApplicationProfile returns the ApplicationProfile field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetApplicationProfile(v map[string]interface{}) { + o.ApplicationProfile = v +} + +// GetPayload returns the Payload field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetPayload(v map[string]interface{}) { + o.Payload = v +} + +// GetPayloadHash returns the PayloadHash field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetPayloadHash(v string) { + o.PayloadHash = &v +} + +// GetMessageSignature returns the MessageSignature field value if set, zero value otherwise. +func (o *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) 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 *SatpMessage) SetMessageSignature(v string) { + o.MessageSignature = &v +} + +func (o SatpMessage) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SatpMessage) 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 NullableSatpMessage struct { + value *SatpMessage + isSet bool +} + +func (v NullableSatpMessage) Get() *SatpMessage { + return v.value +} + +func (v *NullableSatpMessage) Set(val *SatpMessage) { + v.value = val + v.isSet = true +} + +func (v NullableSatpMessage) IsSet() bool { + return v.isSet +} + +func (v *NullableSatpMessage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSatpMessage(val *SatpMessage) *NullableSatpMessage { + return &NullableSatpMessage{value: val, isSet: true} +} + +func (v NullableSatpMessage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSatpMessage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message_action_response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message_action_response.go new file mode 100644 index 00000000000..c83a1c85b75 --- /dev/null +++ b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_satp_message_action_response.go @@ -0,0 +1,162 @@ +/* +Hyperledger Cactus Plugin - Odap Hermes + +Implementation for Odap and Hermes + +API version: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-hermes + +import ( + "encoding/json" +) + +// checks if the SatpMessageActionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SatpMessageActionResponse{} + +// SatpMessageActionResponse struct for SatpMessageActionResponse +type SatpMessageActionResponse struct { + ResponseCode *string `json:"ResponseCode,omitempty"` + Arguments []interface{} `json:"Arguments,omitempty"` +} + +// NewSatpMessageActionResponse instantiates a new SatpMessageActionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSatpMessageActionResponse() *SatpMessageActionResponse { + this := SatpMessageActionResponse{} + return &this +} + +// NewSatpMessageActionResponseWithDefaults instantiates a new SatpMessageActionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSatpMessageActionResponseWithDefaults() *SatpMessageActionResponse { + this := SatpMessageActionResponse{} + return &this +} + +// GetResponseCode returns the ResponseCode field value if set, zero value otherwise. +func (o *SatpMessageActionResponse) 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 *SatpMessageActionResponse) 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 *SatpMessageActionResponse) 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 *SatpMessageActionResponse) SetResponseCode(v string) { + o.ResponseCode = &v +} + +// GetArguments returns the Arguments field value if set, zero value otherwise. +func (o *SatpMessageActionResponse) 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 *SatpMessageActionResponse) 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 *SatpMessageActionResponse) 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 *SatpMessageActionResponse) SetArguments(v []interface{}) { + o.Arguments = v +} + +func (o SatpMessageActionResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SatpMessageActionResponse) 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 NullableSatpMessageActionResponse struct { + value *SatpMessageActionResponse + isSet bool +} + +func (v NullableSatpMessageActionResponse) Get() *SatpMessageActionResponse { + return v.value +} + +func (v *NullableSatpMessageActionResponse) Set(val *SatpMessageActionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSatpMessageActionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSatpMessageActionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSatpMessageActionResponse(val *SatpMessageActionResponse) *NullableSatpMessageActionResponse { + return &NullableSatpMessageActionResponse{value: val, isSet: true} +} + +func (v NullableSatpMessageActionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSatpMessageActionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_session_data.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_session_data.go new file mode 100644 index 00000000000..6e904bbff12 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_request.go new file mode 100644 index 00000000000..0e557e27b31 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_commence_v1_response.go new file mode 100644 index 00000000000..5645a8da57e --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_complete_v1_request.go new file mode 100644 index 00000000000..efb77924763 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_request.go new file mode 100644 index 00000000000..803a0c9123c --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/model_transfer_initialization_v1_response.go new file mode 100644 index 00000000000..e68f2534c41 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/response.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/response.go new file mode 100644 index 00000000000..437cda4e7ee --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/test/api_default_test.go new file mode 100644 index 00000000000..72e567c5bc4 --- /dev/null +++ b/packages/cactus-plugin-satp-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-satp-hermes + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/hyperledger/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client" +) + +func Test_cactus-plugin-satp-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-satp-hermes/src/main/go/generated/openapi/go-client/utils.go b/packages/cactus-plugin-satp-hermes/src/main/go/generated/openapi/go-client/utils.go new file mode 100644 index 00000000000..8b7f77f8563 --- /dev/null +++ b/packages/cactus-plugin-satp-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: 2.0.0-rc.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package cactus-plugin-satp-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/yarn.lock b/yarn.lock index 97e583b1c3e..caa2bee0f5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11100,6 +11100,7 @@ __metadata: openapi-types: "npm:12.1.3" prettier: "npm:3.2.5" protoc-gen-ts: "npm:0.8.7" + replace: "npm:1.2.2" run-time-error: "npm:1.4.0" run-time-error-cjs: "npm:1.4.0" secp256k1: "npm:4.0.3" @@ -22512,6 +22513,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: "npm:^3.2.1" + escape-string-regexp: "npm:^1.0.5" + supports-color: "npm:^5.3.0" + checksum: 10/3d1d103433166f6bfe82ac75724951b33769675252d8417317363ef9d54699b7c3b2d46671b772b893a8e50c3ece70c4b933c73c01e81bc60ea4df9b55afa303 + 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" @@ -22535,17 +22547,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: "npm:^3.2.1" - escape-string-regexp: "npm:^1.0.5" - supports-color: "npm:^5.3.0" - checksum: 10/3d1d103433166f6bfe82ac75724951b33769675252d8417317363ef9d54699b7c3b2d46671b772b893a8e50c3ece70c4b933c73c01e81bc60ea4df9b55afa303 - languageName: node - linkType: hard - "chalk@npm:^3.0.0": version: 3.0.0 resolution: "chalk@npm:3.0.0" @@ -39191,6 +39192,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:3.0.5": + version: 3.0.5 + resolution: "minimatch@npm:3.0.5" + dependencies: + brace-expansion: "npm:^1.1.7" + checksum: 10/8f9707491183a07a9542b8cf45aacb3745ba9fe6c611173fb225d7bf191e55416779aee31e17673a516a178af02d8d3d71ddd36ae3d5cc2495f627977ad1a012 + languageName: node + linkType: hard + "minimatch@npm:5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" @@ -46188,6 +46198,20 @@ __metadata: languageName: node linkType: hard +"replace@npm:1.2.2": + version: 1.2.2 + resolution: "replace@npm:1.2.2" + dependencies: + chalk: "npm:2.4.2" + minimatch: "npm:3.0.5" + yargs: "npm:^15.3.1" + bin: + replace: bin/replace.js + search: bin/search.js + checksum: 10/275ca1a2cfc12476426420fb9a3dda382450395176b4600fdd76ac7d2876b43af96b4ba82c40e3bb46696d3caa2babef13ea1bbb81371d6dd4416ce4f9f77ffd + languageName: node + linkType: hard + "request-promise-core@npm:1.1.2": version: 1.1.2 resolution: "request-promise-core@npm:1.1.2" @@ -56454,7 +56478,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: